Results 1 to 5 of 5

Thread: More .JPG problems... anyone feel up to the task?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Norway
    Posts
    88

    Can't use SavePicture to save as BMP...

    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
    Last edited by ZenMan; Mar 5th, 2001 at 07:22 AM.

  2. #2
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    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...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Norway
    Posts
    88
    That isn't working either. That only reults in a BMP
    image that is entirely gray. I'm stuck....

    More help please

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Save the image property instead and make sure autoredraw is set to true
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Norway
    Posts
    88

    Thumbs up

    Yepp, just needed to set the autoredraw to true
    Thanks a lot for all the help!

    -Zen

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width