Used this code to print a bitmap on printer and display void YourClass::PrintBitmap(CDC *pDC, CPrintInfo *pInfo,UINT Bitmap,int x,int y) { LPBITMAPINFO info; // Structure for storing the DIB information, // it will be used by 'StretchDIBits()' HBITMAP hbit; // Handle to the bitmap to print BITMAP bm; // Structure used for obtaining information // about the bitmap (size, color depth...) int nColors = 0; // Used to store the number of colors the DIB has int sizeinfo = 0; // Will contain the size of info RGBQUAD rgb[256]; // Used to store the DIB color table // The following line loads the bitmap from resource bitmap hbit = (HBITMAP) LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(Bitmap), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); // Obtain information about 'hbit' and store it in 'bm' GetObject(hbit, sizeof(BITMAP), (LPVOID) &bm); nColors = (1 << bm.bmBitsPixel); if(nColors > 256) nColors=0; // This is when DIB is 24 bit. // In this case there is not any color table information // Now we need to know how much size we have to give for storing "info" in memory. // This involves the proper BITMAPINFO size and the color table size. // Color table is only needed when the DIB has 256 colors or less. sizeinfo = sizeof(BITMAPINFO) + (nColors * sizeof(RGBQUAD)); // This is the size required info = (LPBITMAPINFO) malloc(sizeinfo); // Storing info in memory // Before 'StretchDIBits()' we have to fill some "info" fields. // This information was stored in 'bm'. info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); info->bmiHeader.biWidth = bm.bmWidth; info->bmiHeader.biHeight = bm.bmHeight; info->bmiHeader.biPlanes = 1; info->bmiHeader.biBitCount = bm.bmBitsPixel * bm.bmPlanes; info->bmiHeader.biCompression = BI_RGB; info->bmiHeader.biSizeImage = bm.bmWidthBytes * bm.bmHeight; info->bmiHeader.biXPelsPerMeter = 0; info->bmiHeader.biYPelsPerMeter = 0; info->bmiHeader.biClrU