Custom Preview Form Issues
Hi gang! I am working on a project that allows users to specify the dimensions of line graphics (squares and circles) and either print the graphics or display them on a preview form.
I have two questions:
1. Is there any inherent advantages to Loading and Unloading a form versus Showing and Hiding it (RAM, speed, etc.)?
2. If I use the same mathematical calculations for drawing to the form that I use for the printer, I can take advantage of the Object object and just draw to the object. The disadvantage is that the preview can't show the entire length. I was considering scaling the preview calculation by some factor (say, 60%), but I would like to know if anyone has an elegant solution. One thing I haven't tried is using a Picturebox like Marco suggested several months ago. Would that handle the scaling automatically?
1) depends on how much there is in the form. If it seems that the form takes forever to show, then better play Show/Hide
2) In the Picture_Resize event, I set the ScaleWidth and ScaleHeight to be the same as in the Printer object (tip: the width/height ratio of the picture box must remain constant). After that, every drawing looks the same both in the Printer and in the Picture box. Playing with the Picture box ScaleTop and ScaleLeft properties, it is also possible to zoom/pan the drawing. I remember reading an article that was explaining (not surprising) almost the same, I will send the url if I find it.
Thanks for your input, Marco.
I'm going to see how the Picturebox works out.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center