안녕하세요 고고뜌지입니다. 😋
오늘는 '바코드생성기' 프로그램을 만들어봤어요~
<목표>
1. 바코드 생성하기
2. 생선되 바코드 프린터, 저장 하기
<개발기록>
1. Barcode 출력
BarcodeLib.Barcode barcode = new BarcodeLib.Barcode(); pictureBox1.Image = barcode.Encode(BarcodeLib.TYPE.CODE128, textBox1.Text, Color.Black, Color.White); |
- BarcodeLib 라이브러리 추가 해야됨
2. Print
a. PrintDialog
- 일반적으로 인쇄를 눌렀을때 뜨는 공통 다이얼로그 박스
// 다이얼로그 박스 띄우기 PrintDialog1.ShowDialog() |
// 다이얼로그 박스 띄우고 출력버튼 누를시 출력까지됨 // 출력을 위해서라면 이소스를 사용해야 됨 if (PrintDialog1.ShowDialog() == DialogResult.OK ) PrintDocument1.print(); |
b. PrintPreviewDialog
- 미리보기 공통 다이얼로그 박스
c. PrintDocument
- 문서 출력시 사용함
- System.Drawing.Printing 에 예속됨
// Document 선언 // page 이벤트 핸들러 추가 System.Drawing.Printing.PrintDocument Doc = new System.Drawing.Printing.PrintDocument(); Doc.PrintPage += new PrintPageEventHandler(Doc_page); |
// 이미지 페이지 추가하는 법 private void Doc_page(object sender, PrintPageEventArgs e) { e.Graphics.DrawImage(pictureBox1.Image, pictureBox1.Width, pictureBox1.Height); } |
<개선점>
1. print에 대한 공부가 더필요함
실행파일.zip
0.06MB
04. 바코드 생성기.zip
1.34MB
'C# > - Toy projects' 카테고리의 다른 글
[WPF] 간단한 MBTI 검사기 (0) | 2021.02.26 |
---|---|
[WPF] HELLO WORLD (0) | 2021.02.25 |
[winform] 피아노 (0) | 2021.01.20 |
[winform] 시스템 상태(드라이브, CPU, 메모리) 조회 (0) | 2021.01.19 |
[winform] 계산기 (2) | 2021.01.12 |
댓글