开发者

how to set image width and height in vb.net

开发者 https://www.devze.com 2023-01-18 03:02 出处:网络
In html I just do <img src=\"x.jpg\" width=\"1px\" height=\"2px\"> how about in vb.开发者_C百科net. Is there an easy way to do this. When you are viewing the image through the picture boxHow do

In html I just do <img src="x.jpg" width="1px" height="2px"> how about in vb.开发者_C百科net. Is there an easy way to do this. When you are viewing the image through the picture box


How do you display the image? If you load an image into the Image property of a PictureBox you can use the SizeMode property to stretch the image to the size of the PictureBox. You can then set the width and height of the PictureBox.

PictureBox1.Load("image.png")
PictureBox1.SizeMode = PictureBoxSizeMode.Stretch
PictureBox1.Size = New Size(width, height)
0

精彩评论

暂无评论...
验证码 换一张
取 消