Results 1 to 8 of 8

Thread: [RESOLVED] drawing,panning and zooming large images

Threaded View

  1. #1

    Thread Starter
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Resolved [RESOLVED] drawing,panning and zooming large images

    Hey all,

    I am writing an app that will render a pdf drawing and allow the use to drop "bubbles" on the drawing then move the bubbles around. The app needs pan and zoom functionality as well. I have all of this working, but because the pdf drawing as fairly large (~5000x4000 pixels) the performance is not were I'd like it to be.

    To handle all this I am using ghost writer to import the pdf as an image. I then create a class level rectangle that I use in a picturebox.Paint method as the image bounds and draw the pdf to the picturebox. This rectangle is then moved around and resized in the picture box's mouse methods (MouseDown, MouseMove, etc).

    The bubbles are static images that get drawn on an OverlayImage which is the same size as the original pdf image. The overlay is then drawn to the picture box using the same rectangle that governs the location and size of the pdf drawing. So there are 2 images that are drawn in the paint method; the pdf image and the overlay. Doing it this way ensures that the scale of the bubbles (both in size and location) will remain lock-step with the drawing.

    As I mentioned, this all works, but performance kinds sucks, especially when I display the entire drawing. When I zoom in performance gets better, so this implies the performance is being hit by the large size of the drawings.

    My question is in regards to another approach that I'd like to discuss before jumping into it. I am wondering if I can improve performance if I were to set the pdf drawing as the background image of the picture box, then pan and zoom by moving and resizing the entire picture box control and only draw the bubble overlay image in the paint routine. I guess the performance would depend on whether the background image redraws every time the picture box invalidates which I don't know.

    Can anyone lend some insight as to whether this new approach would help with drawing performance?
    Thanks
    kevin
    Last edited by kebo; Jan 18th, 2017 at 10:37 AM.
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width