Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make image shrink or stretch to fit defined space? 3

Status
Not open for further replies.
Use the StretchBlt API to stretch your image to the desired size. It allows you to specify the width and height of the target which can be different to the source.

- Andy.
 
If your picture destination is a form, picturebox or printer object, you can use the object.PaintPicture method Tim

Remember the KISS principle:
Keep It Simple, Stupid!
 
Hi there,

I have tried to use the StretchBlt and it works fine in Windows 2000. When I try to use it in Windows 95 or Windows Me it just gives me a blank picturebox... not fun at all. I have tried to use PaintPicture instead but it gives me a crappy resolution of the picture. Do anyone have any solution to this....????

/Hogger
 
How about using the image control and setting the image1.stretch = True. Then size the Image1 control programatically to fit.
 
Look at the properties of the Image and Picture controls in VB, and play with them. Read Daniel Appleman on the Windows API if you have time.
Looking at your web site, games need fast stuff. Look into the DirectX API.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top