[英]How to Zoom a Drawn Image in PictureBox
大家好,C#.Net中的一個新人。
我需要將使用gdi +繪制的圖像縮放到pictureBox。
我進行了搜索,但找不到一個好的答案, 我發現的只是現有文件 。 有人有主意嗎?
感謝您的回答。
我最誠摯的問候...
如使用轉換和Matrix對象這里描述 。 縮放示例為
private void Scale_Click(object sender,
System.EventArgs e)
{
// Create Graphics object
Graphics g = this.CreateGraphics();
g.Clear(this.BackColor);
// Draw a filled rectangle with
// width 20 and height 30
g.FillRectangle(Brushes.Blue,
20, 20, 20, 30);
// Create Matrix object
Matrix X = new Matrix();
// Apply 3X scaling
X.Scale(3, 4, MatrixOrder.Append);
// Apply transformation on the form
g.Transform = X;
// Draw a filled rectangle with
// width 20 and height 30
g.FillRectangle(Brushes.Blue,
20, 20, 20, 30);
// Dispose of object
g.Dispose();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.