放大.NET矩形 [英] Zoom a Rectangle in .NET

查看:117
本文介绍了放大.NET矩形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个WinForm我用Microsoft.VisualBasic.PowerPacks的矩形,椭圆和直线。

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

是否有可能使一个变焦就可以了?怎么样?

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

推荐答案

假设你只是用它们来画画,没有输入控件,做到这一点。

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

1),将它们移动到用户控件
2)把表单上的用户控件 - 但设置可见=假
3)在窗体的负载,调用用户控件的DrawToBitmap,将其保存
4)在油漆...绘制位图的形式,根据您的变焦缩放它。
5)看家...如果该用户控件的变化,刷新位图;如果缩放或位图的变化,无效的形式。

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.

祝你好运; - )

这篇关于放大.NET矩形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆