如何在VB.NET面板中调整图像大小 [英] How do I resize the image in a VB.NET panel
本文介绍了如何在VB.NET面板中调整图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
由于透明度问题,我不得不将我的图片框控件更改为面板控件。但是如果picturebox具有sizemode.stretchimage属性,则面板控件缺少此选项。有没有办法在面板控件中完成stretchimage?
我尝试过:
尝试了面板的很多属性,但没有成功。
Due to transparency issues, i had to change my picturebox controls to panel controls. But where the picturebox has the sizemode.stretchimage property, the panel control lacks this option. Is there a way to accomplish stretchimage in a panel control?
What I have tried:
Tried a lot of properties of the panel, but without succes.
推荐答案
使用Panel.Paint事件自己绘制。
这样,您可以完全控制绘制图像的方式,内容和位置: Graphics.DrawImage Method(System.Drawing) [ ^ ]
Draw it yourself, using the Panel.Paint event.
That way, you get full control over exactly how, what and where you draw your image: Graphics.DrawImage Method (System.Drawing)[^]
这篇关于如何在VB.NET面板中调整图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文