how to zoom a picture box?

vb6 India
  • 15 years ago

    Hi there,
    I'm creating a tool like Paint Brush, in which a user can make a picture in picture box as well as user can zoom in or zoom out that picture box. I'm able to zoom the picture box with changing its width and height but whenever I used to change picture box's size the image created in it gets lost. how to maintain this stuff.
    Plz help me soon.


    thanx in advance  
    harry

  • 15 years ago

    without knowing how your cogding tihe image its hard to say, are you zooming one picture, or are you zooming one 'back' pick and renderring the result to another image thus keeping the original in a picturebox? this link may be of some use tho


    http://www.vbaccelerator.com/home/VB/Code/Controls/Scroll_Bars/article.asp

  • 15 years ago

    Make sure that the picturebox's autoredraw property is set to true, then


    Try this


    Dim pic2zoom as stdpicture
    set pic2zoom = picbox.image
    picbox.width = picbox.width * 2
    picbox.height = picbox.height*2
    picbox.paintpicture pic2zoom, 0,0,picbox.scalewidth,picbox.scaleheight


    As for making it do like microsoft paint, I am unsure.

  • 11 years ago
    i want to zoom in and zoom out an image in picturebox with one picturebox. went i was klik the button the picture will zoom in or zoom out its mean the picture will become large when i was klik the button zoom in and will become smaller when i was klik the button zoom out thanks for your attention,

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” - Martin Fowler