Results 1 to 14 of 14

Thread: Alternative method to save pictures besides using SavePicture.

  1. #1

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628

    Question Alternative method to save pictures besides using SavePicture.

    Ok, I have a problem. If I use the SavePicture statement to save a picture in a picturebox, some parts get cut off when the picture dimension is greater than the picturebox's dimension.

    Is there an alternative way to save a picture in a picturebox without getting parts of the picture cut off? If there is, please tell me.

    Thanks in advance.

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    You could resize the picture box before saving.

    Or you could create a DC for it, then copy the picture to the DC, then save the DC.

  3. #3

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    Ehh... would you mind telling me how to do that?

  4. #4

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    Can anybody help me!!

  5. #5
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Oh boy.

    Lets see.

    Try this:

    VB Code:
    1. Picture1.picture = Picture1.Image
    2. savepicture Picture1.picture

  6. #6
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    you need to put a path after the savepicture picture1.picture, "c:\path\pic.bmp"

    like that

  7. #7

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    Originally posted by DiGiTaIErRoR
    Oh boy.

    Lets see.

    Try this:

    VB Code:
    1. Picture1.picture = Picture1.Image
    2. savepicture Picture1.picture
    The picture still gets cut off

    Originally posted by DiGiTaIErRoR
    you need to put a path after the savepicture picture1.picture, "c:\path\pic.bmp"

    like that
    Yea I just now noticed that.

  8. #8
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Try this:

    VB Code:
    1. Picture1.AutoSize = true
    2. picture1.picture = picture1.image
    3. savepicture picture1.picture, "c:\pic.bmp"

  9. #9

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    nope

  10. #10
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    You're going to have to make the picturebox as big as the picture is.

  11. #11

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    Ok I'll try whatever to get it working.

    Thanks anyways.


    Edit: If anyone could still help me please do.

  12. #12
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    Well, here's your problem.

    The Image contains the viewable content, the picture contains all persistent content.

    So, if you make changes to a picture, you'll have to have it full-size before you set the .Image to the .Picture.

  13. #13

    Thread Starter
    Fanatic Member Vanguard-MnC's Avatar
    Join Date
    Apr 2002
    Location
    Inactive for like ever.
    Posts
    628
    Originally posted by DiGiTaIErRoR
    Well, here's your problem.

    The Image contains the viewable content, the picture contains all persistent content.

    So, if you make changes to a picture, you'll have to have it full-size before you set the .Image to the .Picture.

    Well I was asking if there's a way to save a picture in a diff. way other than SavePicture.

  14. #14
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111
    You could write raw data, but you still cannot get pixels that are off the DC, which is the same as the image.

    The only way to do that would be to create a DIB before hand.

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