Posted on 1998-06-01
I'm currently working on a project in Visual C++ 1.52 on a Windows for Workgroups 3.11 system. I am trying to print a bitmap image to a thermal receipt printer. I know the printer has the capabilities to print graphics because I can print the image from Paintbrush. I know the basics of output of an image an am confused as to why it won't work in this situation. I have the following code in my OnDraw function in my View class (derived from CFormView):
// Display the bitmap
CDC* pDisplayMemDC = new CDC;
CBitmap *pBitmap = new CBitmap; pBitmap->LoadBitmap(IDB_DEPART_BITMAP); pDisplayMemDC->CreateCompatibleDC(pDC);
pDC->BitBlt( 0, 0, 5000, 5000, pDisplayMemDC, 0, 0, SRCCOPY);
When I try to print nothing is output. When I put the same code in the OnDraw but don't condition before it with "if (IsPrinting)" I have no problem. It comes right up on screen. Any help would be appreciated.