Page 420 OpenGL (Free web hosting services) Super Bible! The offsets are
Page 420 OpenGL Super Bible! The offsets are computed by taking half of the difference of widths and heights: xoffset = (rect.right - xsize) / 2; yoffset = (rect.bottom - ysize) / 2; Normally you might pop up a busy printing dialog for the user, but in this case printing happens so fast it wouldn t be useful. The final code for the PrintDIBitmap function is in Listing 11-11. Listing 11-11 PrintDIBitmap function int PrintDIBitmap(HWND owner, /* I - Owner/parent window */ BITMAPINFO *info, /* I - Bitmap information */ void *bits) /* I - Bitmap pixel bits */ { PRINTDLG pd; /* Print dialog information */ long xsize, /* Size of printed image */ ysize, xoffset, /* Offset from edges for image */ yoffset; RECT rect; /* Page rectangle */ DOCINFO di; /* Document info */ HDC hdc; /* Device context for bitmap */ HBITMAP bitmap; /* Bitmap image */ HBRUSH brush; /* Background brush for page */ HCURSOR busy, /* Busy cursor */ oldcursor; /* Old cursor */ /* * Range check */ if (info == NULL || bits == NULL) return (0); /* * Initialize a PRINTDLG structure before displaying a standard Windows * print dialog */ memset(&pd, 0, sizeof(pd)); pd.lStructSize = sizeof(pd); pd.hwndOwner = owner; pd.Flags = PD_RETURNDC; pd.hInstance = NULL; if (!PrintDlg(&pd)) return (0); /* User chose ‘cancel’ */ /* * OK, user wants to print, so set the cursor to ‘busy’ and start the * print job */
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.