Results 1 to 40 of 91

Thread: ZoomPictureBox: picture control with mouse-centred zooming

Threaded View

  1. #11

    Thread Starter
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    Re: ZoomPictureBox: picture control with mouse-centred zooming

    Hi jfrazier, welcome to the forums.

    You can code the Click event subs of the buttons to change the ZoomFactor property. You could add/subtract to the present zoom factor or multiply/divide it; that's a matter of your own design. Alternatively you could use a number of buttons each to set a specific value of the ZoomFactor (1 means original image size). As an example, suppose you add a "Zoom In" button to the form. Then double click the button and put this in its Click event sub (assuming the ZoomPictureBox is named zpb1):
    Code:
    zpb1.ZoomFactor * = 1.25
    And you could put something similar but with a factor of say 0.75 in the "Zoom Out" button's Click sub.

    The scroll wheel zooming will still work as long as you don't change EnableMouseWheelZooming to False. If you are using ZoomMode "zoom to mouse position", that might look a little odd when you click a button to zoom. But it's easy to change the mode to CenterControl temporarily in the button's Click sub, for example:

    Code:
    	zpb1.ZoomMode = ZPBLibrary.ZoomPictureBox.ZoomType.ControlCenter
    	zpb1.ZoomFactor *= 1.25
    	zpb1.ZoomMode = ZPBLibrary.ZoomPictureBox.ZoomType.MousePosition
    BB

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