In a WinForm I use rectangles, ovals and lines of Microsoft.VisualBasic.PowerPacks.
Is it possible to make a zoom on it? How?
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) 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 ;-)
OK since this is a completely different approach I am going to add another answer! (vb pseudocode):
Global variable for the form:
Dim OrigSizes as new Generic.Dictionary (of Control,Rect)
In the form_load:
SaveSizes(me)
New sub:
Sub SaveSizes(c as Control)
for each c as Control in c.Controls
SaveSizes(c)
next
OrigSizes.Add(c,new rect(c.left,c.top,c.width,c.height)
End Sub
When you zoom...
Sub cboZoomAmount_Change(sender as object, etc...) Handles cboZoomAmount.Change
dim ZoomFac as Double = math.max(0.1,val(cboZoomAmount.text)
for each c as Control in OrigSizes.Keys
c.Left = cint(ZoomFac*OrigSizes(c).Left)
... 3 more lines for top/width/height ...
next c
End Sub
Hack, I know, but if you want Pretty go to eHarmony.com (or better yet CatholicMatch.com ;-)