Zoom a Rectangle in .NET

喜夏-厌秋 提交于 2019-12-11 06:24:30

问题


In a WinForm I use rectangles, ovals and lines of Microsoft.VisualBasic.PowerPacks.

Is it possible to make a zoom on it? How?


回答1:


Assuming you are just using them to draw pictures, there are no input controls, do this.

1) Move them to a usercontrol
2) Put the usercontrol on the form - but set visible=false
3) In the load of the form, call the usercontrol's DrawToBitmap, saving it
4) In the paint ... Draw the bitmap to the form, scaling it per your zoom.
5) housekeeping...If the usercontrol changes, refresh the bitmap; if zoom or bitmap change, invalidate the form.

Good luck ;-)



来源:https://stackoverflow.com/questions/3014753/zoom-a-rectangle-in-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!