屏幕的缩放与布局设置125%后,图片显示不全
var fg =this.CreateGraphics();
Bitmap bmp;
Metafile curMetafile = null;
Graphics g = this.CreateGraphics();
IntPtr hdc = g.GetHdc();
try
{
using (var ms = new MemoryStream())
{
curMetafile = new Metafile(ms, hdc);
Graphics g1 = Graphics.FromImage(curMetafile);
g1.SmoothingMode = SmoothingMode.HighQuality;
g1.FillEllipse(new SolidBrush(Color.Red), new RectangleF(0, 0, 500, 500));
g.ReleaseHdc(hdc);
g1.Dispose();
g.Dispose();
Bitmap bitmap = new Bitmap(curMetafile);
pictureBox1.Image = bitmap;
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
}
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
g.ReleaseHdc(hdc);
g.Dispose();
return;
}
}
比例设置为100%时 ,显示是正常的。
但是设置为125%时,显示就不全了,请教一下大家有解决办法吗?