|
|
Up |
|
|
  |
Author: navid_adnavid_ad Date: Jun 2, 2008 15:42
I'm doing a research and I need to change RGB value of some pixels on
screen runtime. As far as I know, glGet/SetPixel() just have access to
the current application framebuffer but not the whole screen, but I
need to be able to change any pixel on screen even the ones that
belong to other applications.
The code doesn't have to use OpenGL, I can use any library required to
do so, but I prefer to have a cross-platform solution.
I'm using C++ for coding.
Thanks in advance for any suggestion, example, or link.
|
| |
|
| | 10 Comments |
|
  |
Author: jbwestjbwest Date: Jun 2, 2008 19:19
> I'm doing a research and I need to change RGB value of some pixels on
> screen runtime. As far as I know, glGet/SetPixel() just have access to
> the current application framebuffer but not the whole screen, but I
> need to be able to change any pixel on screen even the ones that
> belong to other applications.
>
> The code doesn't have to use OpenGL, I can use any library required to
> do so, but I prefer to have a cross-platform solution.
>
> I'm using C++ for coding.
>
> Thanks in advance for any suggestion, example, or link.
not possible in general. X11 isn't going to let you.
Look for thesource for "meltdown" or a similar old toy app, but this isn't
OpenGL.
jbw
|
| |
|
| | no comments |
|
  |
Author: JonnoJonno Date: Jun 3, 2008 00:59
navid_ad wrote:
> I'm doing a research and I need to change RGB value of some pixels on
> screen runtime. As far as I know, glGet/SetPixel() just have access to
> the current application framebuffer but not the whole screen, but I
> need to be able to change any pixel on screen even the ones that
> belong to other applications.
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 the screen, including other programs'
windows. But if you do this, the other programs will overwrite your
pixels the next time they redraw.
To avoid this, you can capture the current screen to a bitmap, draw this
on a fullscreen window, and then draw over it. You can use OpenGL to do
the drawing, but not the screen grab.
|
| |
| no comments |
|
  |
Author: fungusfungus Date: Jun 3, 2008 01:23
On Jun 3, 9:59 am, Jonno noreply.com> 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 the screen, 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.
|
| |
| no comments |
|
  |
Author: jbwestjbwest Date: Jun 3, 2008 17:55
> On Jun 3, 9:59 am, Jonno noreply.com> 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 the screen, 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.
|
| Show full article (0.91Kb) |
| no comments |
|
  |
Author: navid_adnavid_ad Date: Jun 10, 2008 10:14
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 on screen.
On Jun 3, 5:55 pm, "jbwest" comcast.net> wrote:
>> On Jun...
|
| Show full article (1.58Kb) |
| no comments |
|
  |
Author: aku ankkaaku ankka Date: Jun 11, 2008 02:07
On Jun 10, 8:14Â pm, navid_ad gmail.com> 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 on screen.
>
> On Jun 3, 5:55 pm, "jbwest" comcast.net> wrote:
>
>
>
>> "fungus" artlum.com> wrote in message
>
|
| Show full article (1.94Kb) |
| no comments |
|
  |
Author: navid_adnavid_ad Date: Jun 11, 2008 17:00
On Jun 11, 2:07 am, aku ankka liimatta.org> wrote:
> On Jun 10, 8:14 pm, navid_ad gmail.com> 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" comcast.net> wrote:
>
>>> "fungus" artlum.com> wrote in message ...
|
| Show full article (2.61Kb) |
| no comments |
|
  |
Author: navid_adnavid_ad Date: Jun 11, 2008 17:00
On Jun 11, 2:07 am, aku ankka liimatta.org> wrote:
> On Jun 10, 8:14 pm, navid_ad gmail.com> 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" comcast.net> wrote:
>
>>> "fungus" artlum.com> wrote in message ...
|
| Show full article (2.61Kb) |
| no comments |
|
  |
|
|
  |
Author: navid_adnavid_ad Date: Jun 15, 2008 14:56
Here is the complete program to capture a screenshot, save it to a
file, make some changes(draw a red line), and show it on screen.
#include "iostream"
#include "windows.h"
#include "time.h"
#include
#include
#include
using namespace std;
int main() {
HDC hScreenDC = GetDC(NULL);//GetWindowDC(0);
HDC hmemDC = CreateCompatibleDC(hScreenDC);
int ScreenWidth = GetDeviceCaps(hScreenDC, HORZRES);
int ScreenHeight = GetDeviceCaps(hScreenDC, VERTRES);
|
| Show full article (2.99Kb) |
| no comments |
|
|
|
|