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 Mike Lewis 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 a defined picture box? 1

Status
Not open for further replies.
Add a picture box (picturebox_source) with visible=false and autosize=true.
Add another picture box(picturebox_dest) that is visible=true and autoredraw=false.
Add this code to the paint event of picturebox_dest as 1 line...
Code:
Call picturebox_dest.PaintPicture(picturebox_source.Picture, 0, 0, picturebox_dest.ScaleWidth, picturebox_dest.ScaleHeight, 0, 0, picturebox_source.ScaleWidth, picturebox_source.ScaleHeight, vbSrcCopy)

To load the picture do...
Code:
set picturebox_source.picture=loadpicture("c:\windows\clouds.bmp")

call picturebox_dest.refresh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top