Link to home
Start Free TrialLog in
Avatar of clebo99
clebo99

asked on

Simple VB6 PictureBox Display - Selecting Picture in Code, not picturebox properties.

Let's say I have a jpg file in my c:\temp directory called hockey.jpg.  I have a picturebox (called picture1).  How do I tell the box to display c:\temp\hockey.jpg via coding instead of selecting it in the picturebox properties?  I thought it would be something like:

picture1.picture = 'c:\temp\hockey.jpg' but that is not working.

Chris, Baltimore
Avatar of clebo99
clebo99

ASKER

Ok, I figured that out picture1.picture = loadpicture(ipath).  Now, if the picture is BIG, how do I make it the same size as my picture box?
ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Or use the PaintPicture method to scale it - see help file for details

Picture1.PaintPicture LoadPicture(ipath), destx, desty, destwidth, destheight, clipx, clipy, clipwidth, clipheight, opcode