這是我的代碼。它看起來像DrawIcon
忽略規模轉換,但不是轉換轉換。有沒有什麼特別的原因,或者它只是一個錯誤?Graphics.DrawIcon忽略縮放轉換?
protected override void OnPaint(PaintEventArgs e)
{
Icon icon = SystemIcons.Warning;
Image img = icon.ToBitmap();
// DrawIcon ignores this transform, but not a translate transform
e.Graphics.ScaleTransform(1.5f, 1.5f);
e.Graphics.DrawRectangle(Pens.Red, 60, 90, icon.Width, icon.Height);
e.Graphics.DrawString("Icon", this.Font, Brushes.Black, 100, 100);
e.Graphics.DrawIcon(icon, 60, 90);
e.Graphics.DrawRectangle(Pens.Red, 60, 190, img.Width, img.Height);
e.Graphics.DrawString("Bitmap", this.Font, Brushes.Black, 100, 200);
e.Graphics.DrawImage(img, 60, 190);
}
我認爲這可能是這樣的。我無法在任何地方找到它。 – climbage