Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Jakarta

VB6 - stretching pictures

This topic is 5630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do I stretch a picture in a picturebox to full size. an Imagebox has it as a property but a picturebox does not. I, for certain reasons, do not want to use stretbhblt. And there appears to be a painpicture function but I am not sure how to use it. If someone could help it would be very appreciated, thanks,

Share this post


Link to post
Share on other sites
Advertisement
there is no way to do it with a pic box unless u

a. stretchblt it enabling autoredraw
b. create an image control and copy the picture to it,
enabling autoredraw

autoredraw repaints it each time..


eg..


''this should work
''b. method

form_load

image1.stretch = true
image1.picture = loadpicture(app.path & "\mypic.bmp")
picture1.autoredraw = true
picture1.picture = image1.picture

end sub

Share this post


Link to post
Share on other sites
The second method does not work....
It copeis the picture with the original size... not the new resized size.

I don''t want to use stretchblt

Share this post


Link to post
Share on other sites
quote:
Original post by VBeir
I don''t want to use stretchblt



You don''t have too much choice as far as the Win32 API / VB Interface is concerned.

You need to load the image into a DC, get the picture box''s DC and StretchBlt the image onto the picture box. Enabling auto-redraw is also a good idea because it will simulate double-buffering (use PictureBox.Refresh as your Flip() or Present() function) and it will automatically redraw the image in the picture box if part of it becomes dirty.

Share this post


Link to post
Share on other sites
quote:
Original post by VBeir
the built in VB painpicture function does what I want but I do not know how to use it

if you know this, shouldn''t that be a clue on what to search for at google or msdn?

Share this post


Link to post
Share on other sites
how do you get links to work?

------------------------------------------------------------
Hell is not a bad place to be
It has just been recently added to the attractions list

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!