PDA

Click to See Complete Forum and Search --> : More .JPG problems... anyone feel up to the task?


ZenMan
Mar 5th, 2001, 02:33 AM
Ok, I used the paintpicture to resize my pic. But I can't
save it? Not even when using savepicture to save it
as .BMP?

I have loaded a picture in picture1 and want it resized
into picture2. This works and it shows up fine. But then
if I try to copy picture2.picture to a new picturebox
picture3.picture (this was just to test) nothing shows
up? Also When I try to save the picture in picture2 with
the savepicture command I get this error :

"Run-time error(380) Invalid property value"

and it points to the savepicture code thingy. Is this
because there is no info to in picture2 to save or what?
I guess that would be the reason, but then I don't
understand. Cause it shows the picture in picture2
perfectly?? Well... if anyone can help, that would be
greatly appreciated.

Here's the code that resizes the picture in picture1 and
copies the resized picture into picture2:
Private Sub command1_click()
Picture2.PaintPicture Picture1.Picture, 0, 0, 1400, 700
With Picture2
.Height = Picture1.Height
.Width = Picture1.Width
End With
End Sub

Here's the button I use to save the picture :
Private Sub command2_click()
SavePicture Picture2.Picture, "c:\test2.jpg"
End Sub

-Zen

PsychoMark
Mar 5th, 2001, 07:28 AM
The picture property doesn't contain anything, since you didn't use Picture2.Picture = Picture1.Picture, but the PaintPicture method.

Try using Picture2.Image with the SavePicture...

ZenMan
Mar 5th, 2001, 07:52 AM
That isn't working either. That only reults in a BMP
image that is entirely gray. I'm stuck....

More help please :)

kedaman
Mar 5th, 2001, 10:30 AM
Save the image property instead and make sure autoredraw is set to true

ZenMan
Mar 5th, 2001, 04:36 PM
Yepp, just needed to set the autoredraw to true :)
Thanks a lot for all the help!

-Zen