screen capture code?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Rabid Mantis
Posts: 61
Joined: Sun May 08, 2005 11:30 am

screen capture code?

Post by Rabid Mantis »

I'm making something similar to a macro program, and I need it to be able to check for certain images on certain parts of the screen.

Does irrlicht have anything that might help to capture whatever happens to be on the screen within a certain rectangle and store it, then compare the captured image to a pre-loaded bitmap? The program itself will have no interface, other than the irrlicht console, so it will be capturing whats going on on the windows desktop mostly.

I don't know how to get the actual capture... Did any kind of capture or screenshot code get added in?

after that, i was hoping irrlicht would have something for comparing the images. If not, it shouldnt be too hard to write some pixel-by-pixel comparison code.

thanks
Cristian

Post by Cristian »

Yo DUDE! Are you out of your mind?(:) just kidding) Comparing image similarities is just being devlelopped as a top feature for security cameras and you want it in Irrlicht?
If you want a start try making some position intervals and check if a mesh is positioned inside the interval.

Code: Select all

core::vector3df<int> PosArrayInterv[1];
PosArrayInterv[0]= core::vector3df <int> (3,3,3);
PosArrayInterv[1]= core::vector3df <int> (4,4,4);
//If the mesh is between the two positions
if (mesh->getPosition()<PosArrayInterv[1] && mesh->getPosition()>PosArrayInterv[0])
{
//Do what you want to do
}
Rabid Mantis
Posts: 61
Joined: Sun May 08, 2005 11:30 am

Post by Rabid Mantis »

No, i think I gave you the wrong idea. I'm not comparing similarities, i want to test to see if that exact image is in a certain spot. the image being tested for is identical to the loaded bitmap its being compared to.

example: I've got a bitmap of a program icon. I want to capture a rectangle from a certain place on the desktop and see if that icon is there. It may not make sense WHY i'd want to do this, but just go with it :p

my main concern is GETTING the screen capture. I pretty much know how to compare them pixel by pixel if irrlicht can't do it.
Ronin
Posts: 116
Joined: Wed Mar 03, 2004 6:23 pm
Location: Germany

Post by Ronin »

Take a look at this, maybe it is what you are looking for...

http://irrlicht.sourceforge.net/phpBB2/ ... shot#40542
YASS - Yet Another Space Shooter - www.yass-engine.de
Rabid Mantis
Posts: 61
Joined: Sun May 08, 2005 11:30 am

Post by Rabid Mantis »

It does look useful, but I cant find alot of the code you're using in the API.... things like CreateOffscreenPlainSurface and GetFrontBufferData. I even seached my irrlicht source code and didnt come up with anything. Is that dx stuff?

I wanted to see if GetFrontBufferData captured the entire desktop or only the active program.
Ronin
Posts: 116
Joined: Wed Mar 03, 2004 6:23 pm
Location: Germany

Post by Ronin »

Yes it is directx, you need the sdk to compile it...

The directx code captures the whole screen including other windows if you are in windowed mode. About the opengl code I'm not quite sure at the moment.
YASS - Yet Another Space Shooter - www.yass-engine.de
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Why, Ronin? Your code for opengl you've posted here worked for me. Thank you!
Post Reply