Results 1 to 11 of 11

Thread: Zoom for picturebox

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    8

    Zoom for picturebox

    I want to be able to create a zoom box with the mouse in order to view portions of a graphic in a picturebox. Any Ideas? Thanks

  2. #2

  3. #3
    Old Member moeur's Avatar
    Join Date
    Nov 2004
    Location
    Wait'n for Free Stuff
    Posts
    2,712

  4. #4
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Zoom for picturebox

    you can record the up and down mouse clicks to get your square and read each pixel one at a time with pget(vb5 & 6 only)
    Then you can have a 2nd picture box and paint the pixels with the line command making a solid square (vb5 & 6 only) of whatever zoom size you wish.
    If you use built-in functions such as stretchblt to do this instead of manually, keep in mind that your output can be anti-aliased in the pasting operation.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  5. #5
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Zoom for picturebox

    if you happen to want to do this in directx instead, i have sample code you could look off of, but the setup is more complicated.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  6. #6

  7. #7
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Zoom for picturebox

    i didn't say built-in to vb. I meant built-in to windows.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  8. #8

  9. #9
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Zoom for picturebox

    Point well taken. I (possibly erronously) assumed the example code in the other form used api blitting, since they almost always do.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  10. #10
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    Re: Zoom for picturebox

    OK i retract my answer. Your sample code does exactly what i suggested. Note: the sample in the other thread does indeed use stretchblt.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

  11. #11

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    8

    Re: Zoom for picturebox

    Thank you very much. This is exactly what I was looking for.

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