-
Hello,
I have some BMPs, JPGs, etc. that my progam "previews". Problem is, is some of the pics are too big to fit in either the IMAGE or PICTUREBOX controls. How can I "fit" the picture, or have the pic automatically scale up or down to "fit" inside the box ?
I am using VB6.
Thanks,
-
Hi,
If you use the image contol and set its Stretch property to TRUE then any picture you place inside will automatically resized to the image box size.
Hope this helps
Shaun
-
<?>
For scale use the stretch property on the image box.
-
When using a PictureBox, use PaintPicture. Make a Form with 2 PictureBoxes. Load your image in Picture2 and insert the following code into the Load() event.
Code:
Private Sub Form_Load()
'Make Picture2 invisible
Picture2.Visible = False
'ReDraw the Picture so it doesn't get cut off
Picture1.AutoRedraw = True
'Draw the Picture on to Picture1
Picture1.PaintPicture Picture2.Picture, 0, 0, Picture1.Width, Picture1.Height
End Sub
-
Thanks everyone...
...everything seems to be working now, thanks for all the help