Unable to output Bitmaps to printer 
Author Message
 Unable to output Bitmaps to printer

I have a Graphics application written as a DLL, the application uses a
combination of bitmaps and vector graphics to present the data as a cad
drawing.

My problem is that I am unable to output the bitmaps to the printer, can you
please help?

The code:

BITMAP pBitMap;
 CBitmap cBitmap;
 if(cBitmap.LoadBitmap( IDB_LOGO )) /*resource*/

  CDC cMemDC;
  if(cMemDC.CreateCompatibleDC (pDC))
  {
   cMemDC.SelectObject(&cBitmap);
   cBitmap.GetBitmap( &pBitMap );

   CSize dbm(pBitMap.bmWidth,pBitMap.bmHeight);
   pDC->DPtoLP(&dbm);
   BOOL test = pDC->StretchBlt(xBit+Clearance.cx,yBit-Clearance.cy,
BitSize-2*Clearance.cx ,-(BitSize-2*Clearance.cy),
    &cMemDC, 0,0,pBitMap.bmWidth, pBitMap.bmHeight, SRCCOPY);
  }
  cMemDC.DeleteDC();
 }
 else{
  _RPT0(_CRT_WARN, "\n Unable to load bitmap from resource.\n");
 }
 cBitmap.DeleteObject();

James



Sun, 27 Jan 2002 03:00:00 GMT  
 Unable to output Bitmaps to printer
Hi,

I have a similar problem where I have a printer DC, a DC, and it's
compatible DC.  When i draw an image from an imagelist onto the compatible
DC and try to stretch blt this into the printer DC, all I get are black
boxes.  Have you seen anything like this?  I can stretch blt from the DC
into the printer DC with no problem...I just can't stretchblt and get an
image from the compatible dc.  

Any suggestions or insight?

Quote:

> I have a Graphics application written as a DLL, the application uses a
> combination of bitmaps and vector graphics to present the data as a cad
> drawing.

> My problem is that I am unable to output the bitmaps to the printer, can you
> please help?

> The code:

> BITMAP pBitMap;
>  CBitmap cBitmap;
>  if(cBitmap.LoadBitmap( IDB_LOGO )) /*resource*/

>   CDC cMemDC;
>   if(cMemDC.CreateCompatibleDC (pDC))
>   {
>    cMemDC.SelectObject(&cBitmap);
>    cBitmap.GetBitmap( &pBitMap );

>    CSize dbm(pBitMap.bmWidth,pBitMap.bmHeight);
>    pDC->DPtoLP(&dbm);
>    BOOL test = pDC->StretchBlt(xBit+Clearance.cx,yBit-Clearance.cy,
> BitSize-2*Clearance.cx ,-(BitSize-2*Clearance.cy),
>     &cMemDC, 0,0,pBitMap.bmWidth, pBitMap.bmHeight, SRCCOPY);
>   }
>   cMemDC.DeleteDC();
>  }
>  else{
>   _RPT0(_CRT_WARN, "\n Unable to load bitmap from resource.\n");
>  }
>  cBitmap.DeleteObject();

> James

*****************************************
Valerie Lynn Bielarczyk
University of Illinois - Urbana/Champaign
College of Engineering - Computer Science
http://www.ews.uiuc.edu/~bielarcz
*****************************************


Sun, 27 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HighColor - Unable to open 256 color bitmaps

2. HighColor - Unable to open 256 color bitmaps

3. Unable to get the printer handle with OpenPrinter

4. Unable to sync input and output streams

5. unable to scroll output window

6. Double Buffering Of Screen Output W/O BITMAPS

7. output to a printer

8. Output to printer

9. Need help on printer output.

10. Outputting printer control codes with fprintf

11. Printer output

12. Printer output?

 

 
Powered by phpBB® Forum Software