quick question about getting pixels
quick question about getting pixels
Is there a way to get a pixel from outside the program window, such as from the desktop or another running application?
-
- Posts: 45
- Joined: Fri Mar 09, 2007 8:06 pm
Like a screenshot? Is that what your meaning? If so, i beleive there is a way, havnt really checked into it yet.
But if you mean grabbing colors and sections off the desktop to view inside of irrlicht, i would suppose you need some kind of recorder to show whats going on behind the irrlicht screen. But ive never heard of anything like that.
Please explain with a little more detail on what you want to do. And i will try my best to see what i can do for you.
But if you mean grabbing colors and sections off the desktop to view inside of irrlicht, i would suppose you need some kind of recorder to show whats going on behind the irrlicht screen. But ive never heard of anything like that.
Please explain with a little more detail on what you want to do. And i will try my best to see what i can do for you.
I know there's dx code you can use to capture images from the screen, not just within one window, but what's showing on the entire screen. I don't really need to do that so much as capture a single pixel. For example if i'm making a simple security program to see if someone messes with an icon on my desktop, my program can be running in the background to test if an icon has been moved or clicked on. If so, then I can have my program excecute whatever i need done.
-
- Posts: 45
- Joined: Fri Mar 09, 2007 8:06 pm
so you want some sort of background service to monitor your PC right?
What exactly do you want it to monitor? Because from the sounds of it Irrlicht isnt the way to go for this.
Explain exactly what you are wanting to try and accomplish. Because there are a wide variety of things it could be you want done, Would help lots more if we knew what you want done.
You dont have to go in complete detail, just the basics of what you want done.
From the sounds of it, you want to grab a color off the desktop, because you are reffering to a pixle. Am i right?
What exactly do you want it to monitor? Because from the sounds of it Irrlicht isnt the way to go for this.
Explain exactly what you are wanting to try and accomplish. Because there are a wide variety of things it could be you want done, Would help lots more if we knew what you want done.
You dont have to go in complete detail, just the basics of what you want done.
From the sounds of it, you want to grab a color off the desktop, because you are reffering to a pixle. Am i right?
-
- Posts: 45
- Joined: Fri Mar 09, 2007 8:06 pm
What OS are you using?
in windows, you can get ti by doing this(Not sure it compiles right and is 100% perfect...)
in windows, you can get ti by doing this(Not sure it compiles right and is 100% perfect...)
Code: Select all
HDC DeskDC;
//I think both of these produces the same result.
//The cursor will not be 'getpixeled' though.
//Anyway, dont use both at the same time, if so you'll grab 2 and drop 1 ;)
DeskDC=GetDC(NULL);
DeskDC=CreateDC("DISPLAY",NULL,NULL,NULL);
u32 PixColor=GetPixel(DeskDC, 50,50);
ReleaseDC(NULL, DeskDC);
If you don't have anything nice to say, don't say anything at all.
thanks.Luben wrote:What OS are you using?
in windows, you can get ti by doing this(Not sure it compiles right and is 100% perfect...)Code: Select all
HDC DeskDC; //I think both of these produces the same result. //The cursor will not be 'getpixeled' though. //Anyway, dont use both at the same time, if so you'll grab 2 and drop 1 ;) DeskDC=GetDC(NULL); DeskDC=CreateDC("DISPLAY",NULL,NULL,NULL); u32 PixColor=GetPixel(DeskDC, 50,50); ReleaseDC(NULL, DeskDC);
I'm using visual studio 2005 c++ with windows xp. That code works for windows ce or later. My compiler doesnt recognize the HDC identifier.
I figured irrlicht probably didnt have its own functions for this, but i thought i'd ask. If anything, i was hoping there was a quick and easy way to do it that someone would be familiar with. I guess if not, i can just use the dx stuff to capture a part of the screen and check the desired pixel from there.NicholasMag wrote:hrm, the only way i would see anyone doing this is finding an open source project that grabs a pixle, and implement it with irrlicht, because as far as i know Irrlicht doesnt support it.
Will do some research though, im sure it can be done.