GDI & GDI+
[C#] 이미지 출력 (확대/축소)
iwoohaha
2008. 12. 3. 00:31
반응형
1. 이미지 파일로부터 이미지 로드
Bitmap _bmp = new Bitmap(imgFilePath);
2. 이미지 스케일링
double dZoomPercent = 200;// 200% 확대
Bitmap _bmpScaled = new Bitmap(_bmp, (int)(_bmp.Size.Width * dZoomPercent / 100), (int)(_bmp.Size.Height * dZoomPercent / 100));
3. 이미지 출력
Graphics g = CreateGraphics();
g.DrawImage(_bmpScaled, 0, 0);
샘플 프로젝트
Bitmap _bmp = new Bitmap(imgFilePath);
2. 이미지 스케일링
double dZoomPercent = 200;// 200% 확대
Bitmap _bmpScaled = new Bitmap(_bmp, (int)(_bmp.Size.Width * dZoomPercent / 100), (int)(_bmp.Size.Height * dZoomPercent / 100));
3. 이미지 출력
Graphics g = CreateGraphics();
g.DrawImage(_bmpScaled, 0, 0);
샘플 프로젝트
반응형