C#的Bitmap如何控制长宽?
((Bitmap)this.images[0]).Save(filename, info, ep);
Bitmap bmpSource = new Bitmap(filename);
float fSourceHorResolution = bmpSource.HorizontalResolution;
float fSourceVerResolution = bmpSource.VerticalResolution;
//图象dpi
float fTargetHorResolution = 200;
float fTargetVerResolution = 200;
Bitmap bmpTarget = new Bitmap(1754, 2338);//此处是像素,我需要是210*297mm的A4纸大小.并无提供方法.
Graphics g = Graphics.FromImage(bmpTarget);
g.DrawImage(bmpSource, 0, 0, iSourceWidth, iSourceHeight);
bmpTarget.SetResolution(fTargetHorResolution, fTargetVerResolution);
bmpTarget.Save("C:\\test.tif");