Hi! I am working on a program that takes a screenshot (putting that in the clipboard), puts that into an image box and analyzes it then does the process over and over again. As the program runs my RAM basically ducks for cover and hides because the big hungry images or screenshots do not go away until the program is finished gobiling up the RAM regardless of what it tries to do. So my question is: how do I clear the clipboard? I have been searching around the internet for sometime and I want to be very specific, I am working with Visual Basic . NET 2003 Professional Edition. I cannot simple type ClipBoard.Clear, that is not supported past
VB 6. I have found these steps though:
1. PInvoke and call OleSetClipboard API from ole32.dll or
2. Use PInvoke and call the following sequence of methods declared in
user32.dll
OpenClipboard
EmptyClipboard
CloseClipboard
Is this somehow calling the old VB6 interface and working with the clipboard that way? If so what does PInvoke and call OleSetClipboard API mean? Thanks.
P.S. I am only analyzing one specific pixel, is there a way to determine the color of a pixel real-time, without having to take a screenshot and analyze it? Or can I take a screenshot of a very small area? A 10x10 or perhaps maybe even of one pixel? Thanks again.