Results 1 to 8 of 8

Thread: [RESOLVED] Save\Screenshot all visible pictures inside a picture

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Resolved [RESOLVED] Save\Screenshot all visible pictures inside a picture

    Hello.

    I would like to create a little game with the option to save the picture that will be created by the user. The problem is that there will be few PictureBoxes inside 1 big PictureBox and I want them all to be considered as one picture and save them as one, to .jpg or any other image file format.
    I have other ways to create the game but I'm afraid it will run slow.

    I thought a screenshot of the picture area will do the job but I didn't know how to do it and I only found threads that show how to do screenshot of the form, whole screen or it saves\screenshots only one picture instead of all of the pictures inside. I dont need whole screen or form or just one picture.


    I'm not a professional vb programmer so I would like to see a code with some clear explanation.

    If anyone has a way to do it, it will be appreciated.
    Thanks.

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Save\Screenshot all visible pictures inside a picture

    savepicture picture1.picture, "c:\somepath\filename.bmp"
    if you want to convert to jpg or someother format you will need to have additional code

    it may be neccessary to set the picture property to the image property first
    picture1.picture = picture1.image
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61
    Sorry but that only saves one picture and not the one that is inside of it.

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Save\Screenshot all visible pictures inside a picture

    microsoft has this method for capturing screen or part of
    http://support.microsoft.com/default...b;en-us;161299
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Save\Screenshot all visible pictures inside a picture

    You could also copy all pictures into a single, large picture box (possibly hidden). It'd be inefficient but effective if you have to, say, scroll.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Re: Save\Screenshot all visible pictures inside a picture

    Quote Originally Posted by jemidiah View Post
    You could also copy all pictures into a single, large picture box (possibly hidden). It'd be inefficient but effective if you have to, say, scroll.
    1. I need all the pictures one on each other.

    2. Thanks westconn1. That didn't solve the problem but thanks to it, the solution came to my mind. All I had to do is to put the pictures in the top-left corner of the form, change the size of the form to the width and height of the big picture and then screenshot the form and after the screenshot put everything back.

    I'll post what I did for anyone who will have the same problem in the future:
    Attached Files Attached Files

  7. #7
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Save\Screenshot all visible pictures inside a picture

    While I don't understand

    Quote Originally Posted by kiaraire View Post
    1. I need all the pictures one on each other.
    I'm glad you figured out a way that works. One thing about resizing your form, though, is that forms have a maximum size that's resolution-dependent. On some machines, pictures might be cut off, depending on the specifics of your program.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  8. #8

    Thread Starter
    Member
    Join Date
    Jun 2008
    Posts
    61

    Re: Save\Screenshot all visible pictures inside a picture

    Quote Originally Posted by jemidiah View Post
    While I don't understand



    I'm glad you figured out a way that works. One thing about resizing your form, though, is that forms have a maximum size that's resolution-dependent. On some machines, pictures might be cut off, depending on the specifics of your program.
    Yes... ofcourse. I noticed it, but lucky me, I dont need to use big pictures.
    Btw forgot to change thread to resolved.

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