Re: Modify screen pixels



On Jun 11, 2:07 am, aku ankka <ju...@xxxxxxxxxxxx> wrote:
On Jun 10, 8:14 pm, navid_ad <navid.fal...@xxxxxxxxx> wrote:



Thanks eceryone for your help, I figured it out half way. First of
all, I decided to get it to work just on Windows
for right now, I tried getPixel and setPixel in a loop to read and
write all the pixels to/from a buffer,
it works but it is just too slow. It takes 6 seconds to read all
pixels and 3 seconds to write them.
Now I'm using GetDIBits to capture a screenshot to a buffer which is
very fast and I can even
save it to a bitmap file. and I can change colors in buffer. The part
that I couldn't get it to work is
the SetDIBits which is suppose to show the buffer onscreen.

On Jun 3, 5:55 pm, "jbwest" <jbw...@xxxxxxxxxxx> wrote:

"fungus" <openglMYSO...@xxxxxxxxxx> wrote in message

news:9f7d5e71-68cc-41e2-84d7-d7e0b02462c2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

On Jun 3, 9:59 am, Jonno <jo...@xxxxxxxxxxx> wrote:
There is no glGetPixel or glSetPixel in OpenGL.
Windows API has GetPixel and SetPixel, and these (like all Windows GDI
functions) can draw to anywhere on thescreen, including other programs'
windows. But if you do this, the other programs will overwrite your
pixels the next time they redraw.

I'm not sure even this works any more on Windows Vista.

--
<\___/>
/ O O \
\_____/ FTB. Remove my socks for email address.

Even if it did (a similar grab can be done in X11) its not quite what was
asked for.
If anything on thescreenis changing in any way, this snap & replace
approach won't be right.
You'd have to snap & replace at refresh rate to make it "right" -- tough to
do.

jbw- Hide quoted text -

- Show quoted text -

More important question is what you trying to do with this.. it could
be that
_this_ question becomes irrelevant if better means are found to do
what ever it is you are doing.

I want to check all the pixels on screen and detect the pixels with
specific range of RGB next to each other. For example colorblind
people can not see a red text on a green background, now if I find all
the green pixels next to red pixels on screen and draw a line between
them, they can read the text!
So the steps are like this:
1. Capture the screen to an array.
2. Process the captured screen pixel by pixel for that specific range
of RGB.
3. Draw the line by changing RGB values of the array.
4. Show the array of RGB back on screen.
.



Relevant Pages

  • Re: Modify screen pixels
    ... pixels and 3 seconds to write them. ... Now I'm using GetDIBits to capture a screenshot to a buffer which is ... Windows API has GetPixel and SetPixel, and these (like all Windows GDI ... specific range of RGB next to each other. ...
    (comp.graphics.api.opengl)
  • Re: Video Mode 13h in windows XP ... impossible?
    ... out the fluff so they can concentrate on just plotting pixels without ... Actually, running full-screen and not in a window, Windows simply gets ... keys to the video display... ... (some cards do not come with VESA routines so Microsoft, I think, ...
    (alt.lang.asm)
  • Re: Linux, X, ld, gcc, linking, shared libraries and stuff
    ... The problem (on Windows and on X) is that the "pixel format" is different ... Which is how the images are actually stored in RAM (note: ... with addresses to routines that "portably" create images, get pixels, put ... "Star people, ...
    (alt.lang.asm)
  • Re: 800x600, 1024x768...1400x1050 res.
    ... Good web pages do indeed look similar at all resolutions, ... of characters a particular user wants to see, not about counting pixels. ... bigger and they like to work with many windows open at once. ... It's also a good practice to _avoid_ setting widths whenever you ...
    (alt.html)
  • Re: BYTE Article of Mega II
    ... I believe that RGB matrix is constructed by TTL gating. ... If RGB matrix is a ROM, I am sure that four NTSC pixels out of 140 NTSC pixels will display on the screen at 98% correct. ...
    (comp.sys.apple2)