2
我有一个PictureBox
,当我由于某种原因更改图片时,PictureBox
的位置显示不正确。它显示在左下角而不是左上角。更改图像时C#图片框位置发生变化
如果我检查顶部,左侧,位置等值是否全部正确。有什么我忘记了吗?
myPictureBox.Image = image;
myPictureBox.Location = new Point(0,0);
我有一个PictureBox
,当我由于某种原因更改图片时,PictureBox
的位置显示不正确。它显示在左下角而不是左上角。更改图像时C#图片框位置发生变化
如果我检查顶部,左侧,位置等值是否全部正确。有什么我忘记了吗?
myPictureBox.Image = image;
myPictureBox.Location = new Point(0,0);
我想这是因为SizeMode
属性设置为AutoSize
,试图将其设置为Normal
。
祝你好运!
你使用WPF或WinForms?如果使用WPF,你使用了什么样的面板?画布,网格,DockPanel? – 2011-01-30 17:31:11
我正在使用WinForms。 Picturebox直接在表格上 – Revvion 2011-01-30 17:58:18