Picture box

emidio
07-29-2003, 11:34 AM
how can i load an image from the disk to a picture box with the size of the picture box ? is this posssible ?

please give me the code...

from Emidio braga.

GavinO
07-29-2003, 11:37 AM
I'm unsure what you mean about the sizing, but to load a picture the LoadPicture function is most useful.

elija
07-29-2003, 11:44 AM
Use an image control rather than a picturebox and set the stretch property of the image control to true. This wont preserve the aspect ratio tho.

Elija =8>)

passel
07-29-2003, 04:44 PM
how can i load an image from the disk to a picture box with the size of the picture box ? is this posssible ?

please give me the code...

from Emidio braga.

Have a nonvisible picture (picture1 for instance) with autosize set true
Have a picture box you want to use for display (say picture2).
Load the picture into picture1 then paint it into picture2
For example:
Picture1.Picture = LoadPicture("c:\t.bmp")
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum