Custom Preview Form Issues


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Custom Preview Form Issues

  1. #1
    Join Date
    Oct 2004
    Posts
    51

    Question 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?

    Thanks!

    Anklebuster

  2. #2
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    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.

    Marco

  3. #3
    Join Date
    Oct 2004
    Posts
    51
    Thanks for your input, Marco.

    I'm going to see how the Picturebox works out.

    Anklebuster

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center