作者kaxas (无风不起浪)
看板C_Sharp
标题[问题] 如何更改由档案汇入的图片大小呢?
时间Tue Dec 8 21:59:40 2009
我最近在小一个小程式,类似小画家的功能,我想要汇入一张图进去FORM上的画布,
每次图太大放上去时,他会只显是左上角的图案出来,想要问一下各位,有没有什麽
方法可以让图形重新改变大小呢?
以下是我的一小段程式码。
OpenFileDialog openFileDialog1 = new OpenFileDialog();
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
Image x1= Image.FromFile(openFileDialog1.FileName);
TextureBrush x = new TextureBrush(new Bitmap(x1));
Point[] ap = { new Point(0, 0), new Point(0, 250),
new Point(320, 250), new Point(320, 0) };
Graphics g = Graphics.FromImage(b);
g.FillPolygon(x,arrpoint);
Graphics g1 = this.CreateGraphics();
g1.FillPolygon(x, arrpoint);
}
请问要加什麽进去才可以呢?谢谢各位
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.229.54.62
1F:→ mortleo:用 g1.DrawImage 12/08 22:18