// Get client geometry
TRACE(" client zone : (%d;%d)\n",size.cx,size.cy);
// Lines have to be 32 bytes aligned, suppose 24 bits per pixel
// I just cropped it
size.cx -= size.cx % 4;
TRACE(" final client zone : (%d;%d)\n",size.cx,size.cy);
// Create a bitmap and select it in the device context
// Note that this will never be used ;-) but no matter
CDC *pDC = GetDC();
// Alloc pixel bytes
int NbBytes = 3 * size.cx * size.cy;
unsigned char *pPixelData = new unsigned char[NbBytes];
if( FALSE == wglMakeCurrent(m_OpenGLCtrl.getDC(), m_OpenGLCtrl.getRC()))
AfxMessageBox("FALSE from wglMakeCurrent");
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
// Process any inserts in lpMsgBuf.
// Display the string.
// Free the buffer.
LocalFree( lpMsgBuf );
// Copy from OpenGL
Can you help me in the following thing.?
I need to capture the total screen, without having to use the BitBlt(...) function because this it takes a long time 450 mseg approximately. Does exists some method in OpenGL to make it. Or otherwise, witch library I should to use?.
How can I get the from the clipboard
and print it?
Here is what I've tried:
HGLOBAL global = (HGLOBAL)GetClipboardData(CF_DIB);
BITMAPINFOHEADER* bmpHeader = (LPBITMAPINFOHEADER)global;
BITMAPINFO* bmpInfo = (LPBITMAPINFO)global;
int nColors = bmpHeader->biClrUsed ? bmpHeader->biClrUsed : 1 << bmpHeader->biBitCount;
Thank you for your article demonstrations, it is very helpful to everyone who interest in OpenGL programming,I think.
I have not good idea on how to pick some control points of polygon meshes on MFC+OpenGL environment. Would you like to
give some suggestion if you have time? It will be very thankful if I can get a demo project about this problem?
Hello, the image file diplayed in this article shoing that it not just as saving into jpg. In left side ofthe splliter window..i am seeing a sphere in 3D..I dont thing so that as an image..what i am feling is, it's a 3D object, may be that window also itself an openGL window..how ot make it? and how to place it?