일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- AMBA
- 펌웨어
- Multiple outstanding
- T flip flop
- ordering model
- FPGA
- 구조적모델링
- 스텝모터
- 레지스터슬라이스
- atomic access
- QoS
- APB3
- FGPA #반도체설계 #verilog #시프트레지스터 #uart
- Interoperability
- STM32
- ABMA
- single copy atomic size
- 임베디드시스템
- stepmotor
- out-of-order
- Low-power Interface
- ERROR RESPONSE
- AXI4
- 카운터
- Multiple transaction
- tff
- SoC
- cacheable
- AXI3
- Verilog
Archives
- Today
- Total
CHIP KIDD
[C#] 6. 파일처리 바이너리파일 본문
using System;
using System.IO;
namespace Day02_03_바이너리_파일_처리
{
class Program
{
static void printImage(byte[,] img)
{
Console.WriteLine();
for (int i = 0; i < 10; i++)
{
for (int k = 0; k < 10; k++)
{
Console.Write("{0:d3} ", img[i, k]);
}
Console.WriteLine();
}
}
static void Main(string[] args)
{
/// 1단계 : 파일 열기
string fullName = "C:\\images\\Etc_Raw(squre)\\512\\LENNA512.raw";
BinaryReader br
= new BinaryReader(File.Open(fullName, FileMode.Open));
// 2단계 : 파일 처리하기... 내맘대로..
// 파일 --> 메모리(배열)
int ROW = 512, COL = 512;
byte[,] image = new byte[ROW, COL];
for(int i=0; i<ROW; i++)
{
for (int k=0; k<COL; k++)
{
image[i, k] = br.ReadByte();
}
}
printImage(image);
// 3단계 : 파일 닫기
br.Close();
}
}
}
'전기전자 > C# 시각화프로그래밍' 카테고리의 다른 글
[C#] 8. GUI를 이용한 영상처리 프로그램 (1) | 2021.04.15 |
---|---|
[C#] 7. 그림파일 알고리즘 Basic (0) | 2021.04.14 |
[C#] 5. 파일처리(텍스트파일) (0) | 2021.04.14 |
[C#] 4. 2차원 배열 (0) | 2021.04.14 |
[C#] 3. 배열기본 : 동적메모리할당 / 가변배열 (1) | 2021.04.13 |