Detect change in pixels in an area
Hey, I am working on a little project and I've come across a problem... I'm very new to vb so some more help than "google it" would be appreciated.. I have googled it and can't seem to find the answer... I've tried getpixel but I don't think it does what I want it to do.
I want to have like an imaginary box set over my form, this box would be relative in size and position to the actual form window, so that if the form were to change size, the box would also change size relative to the form. As well as if the form moves the box should remain at the same position on the form. What I want to happen is simply a yes or no, if the pixels behind the box are nothing but black, then its a 0 if any of them change to any other color, send a 1.
Sorry for this sloppy way of explaining what I need.
Re: Detect change in pixels in an area
This probably belongs in a question forum instead of in General Discussion. See http://www.vbforums.com/showthread.p...82-Please-Read
You should decide whether your question is about VB or VB.Net and choose the appropriate question forum.
Re: Detect change in pixels in an area
The last time I posted a question like this a mod put it here?
Re: Detect change in pixels in an area
Without knowing which language you are working with, here is as good as anywhere, but this sounds like .NET, in which case it should be there. If the question is specific to a certain language, then it should be in the forum for that language.
As for the question, it's not all that easy. Having some virtual rectangle that moves around and sizes with the form is pretty easy. As long as the coordinates of the rectangle are in form coordinates, the rectangle will move with the form. As far as sizing goes, though, there are a couple ways that can be done, but the coordinates, and size (length,width) of the rectangle can always be relative to the size of the form. For example, if the X coordinate is 20% of the width of the form, and the width is 10% of the width of the form, then the X coordinate of the rectangle and the width of the rectangle can be calculated, regardless of how the form changes in size.
However, the part about checking the pixels inside the rectangle is not so easy. The problem is that there could be LOTS of pixels, and checking them may be kind of slow. That gets fairly language specific, though.
Re: Detect change in pixels in an area
@ dilettante! I agree however, as Shaggy Hiker points out without know which language the original poster is using the only thing we can be certain is the thread does not belong in the Community section.