tags:

views:

69

answers:

1

Hello , I developing a Antichat for counter strike using C++ .This AC need to take screenshots and upload them to a specified server. The problem is that in Win7/Vista the Screenshots are black. I made researches on web but didn't find something that helped me.

I saw TAKSI sources, test all versions and Taksi 0.3 is good enough and not very big but i cant debug the source ( http://sourceforge.net/projects/taksi/files/stable/taksi-0.3/taksi-0.3-src.zip/download ) . when i debug this with all DirectX 9 SDK includes and libs and STL , i get a lot of errors. (also i read the Build.txt info, and tryed with Visual C++ 2006,DC++, Visual C++ 2010 )

I am begginer with C++ apps and i really want to do this. If someone could give a help or simplify the taksi 0.3 source for me ( i need only to take small screenshots on OpenGL ) and give me the source will helped me very much and CS comunity.

Also if nobody will have time to simplify the 0.3 source for me i will appreciate if you could explain me how to debug that( very explained txt:) )

Please help me:P

A: 

If you can get into the OpenGL/GLUT display callback function, you can add a call to glReadPixels at the end of the function, somewhere after glutSwapBuffers();. Next you would need to write the RGB image buffer, filled in by glReadPixels, to a file, in the appropriate format, perhaps using the IJG JPEG library if the application doesn't already have an image handling library.

int width = 1024;  // would be better to get actual window dimensions
int height = 768;
unsigned char *img_rgb[width * height * 3];  // each pixel is three bytes (RGB)
...
glReadPixels(0,0, width,height, GL_RGB, GL_UNSIGNEDBYTE, img_rgb);
jholl
thank you for your reply jholl , this is very useful. Can you help me with infos about how to hook a specified application ? ( the application process name is hl.exe -OpenGL )
S. Gabi