Problems printing a COLOR bitmap on a COLOR laser printer 
Author Message
 Problems printing a COLOR bitmap on a COLOR laser printer

Hi,

I used this code to draw a GRAY bitmap on a BLACK&WHITE laser printer, which
works fine if you change the type of your BITMAP resource to MONOCHROME. We
recently purchased a COLOR laser printer and now we want to print the logo
in color but we get a BLACK rectangle where the logo
should be... I think it's a palette problem... Any ideas ?

void CBCDoc::DrawBitmap(CDC* dc, double x, double y, double xx, double yy,
int res, double type)
{
  CBitmap Bitmap;
  CDC Bdc;
  BITMAP BitmapStruct;
  CPalette BitmapPalette;
  if (Bitmap.LoadBitmap(res))
  {
    if (Bdc.CreateCompatibleDC(dc))
    {
      if (BitmapPalette.CreateHalftonePalette(&Bdc))
      {
        Bdc.SelectPalette(&BitmapPalette,0);
        Bitmap.GetBitmap(&BitmapStruct);
        CBitmap* oldBitmap = Bdc.SelectObject(&Bitmap);
        dc->SetStretchBltMode(BLACKONWHITE);
        dc->StretchBlt(x,y,xx-x,yy-y,&Bdc,0,0,BitmapStruct.bmWidth,BitmapStruct.bmHeight,type);
        Bdc.SelectObject(oldBitmap);
        Bdc.DeleteDC();
      }
    }
  }

Quote:
}




Tue, 23 Jan 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Problems printing a COLOR bitmap on a COLOR laser printer

2. How can print color bitmap on dark printer?

3. Problem print text in matrix and laser printer (width size of font)

4. Problem print text in matrix and laser printer

5. ++ Printing colors ++ Printing Colors ++

6. Detecting Color Pallete ( 16 colors , or 256 colors, or Hi color) URGENT

7. Converting a high-color bitmap to 16 colors

8. Need help to select a 256 color bitmap into 16 bit color DC

9. displaying 256 color bitmap in 256 color mode

10. Printing to the printer with COLOR!??

11. Printing Color Views on Black&White Printers

12. bitmap printing fine on color printer, but never got gray scaled on mono printer.

 

 
Powered by phpBB® Forum Software