Page 422 OpenGL Super Bible! DeleteObject(bitmap); DeleteObject(brush); DeleteObject(busy); (Post office web site)
Page 422 OpenGL Super Bible! DeleteObject(bitmap); DeleteObject(brush); DeleteObject(busy); DeleteDC(hdc); /* * Restore the cursor and return */ SetCursor(oldcursor); return (1); } Displaying the Bitmap The OpenGL part of our example program begins with displaying the .BMP file. Like most OpenGL programs, this one starts out by setting the current viewport and viewing transformations. glViewport(0, 0, rect->right, rect->bottom); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, rect->right - 1.0, 0.0, rect->bottom - 1.0, -1.0, 1.0); glMatrixMode(GL_MODELVIEW); After this, you draw the bitmap. Here we are scaling the image to fit the current window while maintaining a 1:1 aspect ratio. The following code should look very familiar you used it in the PrintDIBitmap function above: xsize = rect->right; ysize = BitmapInfo->bmiHeader.biHeight * xsize / BitmapInfo->bmiHeader.biWidth; if (ysize > rect->bottom) { ysize = rect->bottom; xsize = BitmapInfo->bmiHeader.biWidth * ysize / BitmapInfo->bmiHeader.biHeight; }; xscale = (float)xsize / (float)BitmapInfo->bmiHeader.biWidth; yscale = (float)ysize / (float)BitmapInfo->bmiHeader.biHeight; xoffset = (rect->right - xsize) * 0.5; yoffset = (rect->bottom - ysize) * 0.5; glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelZoom(xscale, yscale); glRasterPos2i(xoffset, yoffset); glDrawPixels(BitmapInfo->bmiHeader.biWidth, BitmapInfo->bmiHeader.biHeight, GL_RGB, GL_UNSIGNED_BYTE, BitmapBits);
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.