Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个图像框,其中有一个图像 - 我是“缩放”作为 SizeMode(如下所示):
this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
现在我试图获取图像的当前大小(当它被缩放时)——而不是图像的实际大小。例如,如果我这样做:
var size = pictureBox1.Image.Size
这将返回图像的真实尺寸 - 而不是缩放的尺寸。你怎么能得到图像的缩放大小?
我想你要找的是pictureBox1.ClientSize
pictureBox1.ClientSize