怎么获取PictureBox控件中图片的实际尺寸
要获取PictureBox控件中图片的实际尺寸,可以使用以下代码:
int width = pictureBox1.Image.Width;
int height = pictureBox1.Image.Height;
这样就可以获取到PictureBox控件中图片的宽度和高度。请确保在获取之前已经给PictureBox控件的Image属性赋值。
PictureBox " />
要获取PictureBox控件中图片的实际尺寸,可以使用以下代码:
int width = pictureBox1.Image.Width;
int height = pictureBox1.Image.Height;
这样就可以获取到PictureBox控件中图片的宽度和高度。请确保在获取之前已经给PictureBox控件的Image属性赋值。
扫码添加客服微信