I would like to save the client area of the screen to a variable; to be pasted (later in the program) back to the screen. Can anybody point me in the right direction ?
...Thanx...
I think you should look into the clipboard object. If you push alt-print screen to copy a picture of the current form to clipboard then I am sure programmatically you can copy the client area to the clipboard as well.
The clipboard is made available to the user in this program so I can't use it for programming logic as it would overwrite anything that was placed there by the user. It would be just as effective to save the screen to a file though. I can't seem to find any guidance in MS's library for this either.
You can have more than one clipboard object at once. And you can store clipboard objects in a hashtable to keep an array of objects on the clipboard. This is similiar to the feature that MS Office uses when you see the clipboard listed with several objects on the Clipboard window pane. However; you could possibly look into saving it to file with in hash format as well. I am at work with no developer tools at hand but this sounds interesting. I hope I can help you figure this out b/c I am myself curious. Or maybe somone that knows can give us both a solid answer.
I have an idea. Override the OnBackgroundPaint routine of the form and copy the e.graphics object to another object. Then try painting the background of a ImageBox with that same object. Then you could possibly save the image to file that way. Also, maybe you can just tell whatever other surface to paint those arguments. I am not sure at all really but when I get some time I will try this myself.
Well, I stumbled across this link that seems to answer my own question.
I don't quite understand rohit's post (#3) in that thread. Some sample code would be most appreciated... http://www.dotnetrooms.com/showthread.php?t=2
I would personnally look into to BitBlt API it's capable of copying any defined rectangle and copying it to a bitmap or to whereever you want for that matter. It's fast and if you google for 'Vb.net - BitBlt' then you will get a link to a codeproject site that has a tutorial on how to use it.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.