[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.
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
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
Re: Save\Screenshot all visible pictures inside a picture
Originally Posted by jemidiah
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:
Re: Save\Screenshot all visible pictures inside a picture
While I don't understand
Originally Posted by kiaraire
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
Re: Save\Screenshot all visible pictures inside a picture
Originally Posted by jemidiah
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.