且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

调整图像大小以适应图片框

更新时间:2022-11-02 14:23:55

在图片框的 BackgroundImage 属性中设置图片

然后设置图片框的 BackgroundImageLayout = stretch

因此Image将自动适合图片框的大小。

Happy Coding!

:)
set image in BackgroundImage property of picture-box
then set picture-box's BackgroundImageLayout = stretch
thus Image will auto fit to size of picture-box.
Happy Coding!
:)


您需要调整图片框高度和图像的大小。宽度。

非常简单。

创建一个新的大小图片框高度和位图的位图宽度。使用现有图像填写新位图。



有一篇很好的文章描述了它。

使用.NET动态调整图像大小
You need to resize the image for the picture box height & width.
Its pretty straight forward.
Create a new Bitmap of size picture box height & width. Fill-in the new bitmap with the existing image.

There is a nice article which describes it.
Resizing an Image On-The-Fly using .NET


hii ,,



类似的帖子会帮助你



http://www.dotnet-snippets.com/dns/vbnet- resize-image-to-fit-in-picturebox-SID213.aspx [ ^ ]
hii,,

similar thread will help you

http://www.dotnet-snippets.com/dns/vbnet-resize-image-to-fit-in-picturebox-SID213.aspx[^]