Problem printing color bitmap on color printer wih TPW 1.5 
Author Message
 Problem printing color bitmap on color printer wih TPW 1.5

We have a problem printing colour bitmaps under Turbo-Pascal for Windows
1.5 and Windows95 on colour printers (in our case an EPSON STYLUS COLOR
600, but also on HP-printers).
We are using the routine, listed below. If we print b/w graphics
((1-Bit) colour depth) , the pictures appear correctly on the printer.
If we use colour bitmaps (16 colours or 256 colours) we only get a
small, distorted unrecognizable printout.
If we use the same routine with the Device Context for the Screen, the
images are shown correctly in colour on the screen.

Anybody has an idea what is the problem?
Please send answers also by email, because our newsfeed is not always

Thanx for your help !

routine that we use:


      the hScr has been predefined as a handle of the printer by using
CreateDC function.

Procedure PrintBitMap;
        hScrMem,hScr,hPrnMem : HDC;
        BM : TBitMap;
        hbmSource_Org,hbmDest_Org,hbmSource,hbmDest : HBitMap;
        ptSize : TPoint;
        xResPrn, yResPrn : Integer;


          { Load bitmap from the resource file. (Library file) }
          hbmSource := LoadBitmap(hLibrary,'MONO');

          {Get the number of pixels per logical inch along the display
width and height. }    
          xResPrn := GetDeviceCaps(hPrn,LOGPIXELSX);
          yResPrn := GetDeviceCaps(hPrn,LOGPIXELSY);

          {Calculate the desired size.}
          ptSize.x := Round(3*xResPrn / 2.54);
          ptSize.y := Round(3*yResPrn / 2.54);

          hbmDest := CreateCompatibleBitMap(hPrn,ptSize.x,ptSize.y);

          {Create the memory device context for display and printer.}
          hScr := GetDC(h_Wnd);
          hScrMem := CreateCompatibleDC(hScr);
          hPrnMem := CreateCompatibleDC(hPrn);

          {Select the SOURCE bitmap into the memory device context of
          hbmSource_Org := SelectObject(hScrMem,hbmSource);

          {Select the TARGET bitmap into the memory device context of
          hbmDest_Org := SelectObject(hPrnMem,hbmDest);

          {Transfer bits from display to printer.}

          {Print out}  

          {Clear the GDI objects.}


Wed, 18 Jun 1902 08:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Windows Pascal 1.5 - Text color & Background color

2. Windows Pascal 1.5 - Text color & Background color

3. WANTED: A Simple unit for loading 256 color bitmaps using TPW 1.5

4. Delphi: 16 color bitmap w/non-system colors

5. TPW 1.5 using LPT1 to print with LEXMARK PRINTER

6. I like to print color Line graphics, text color in a hp deskject

7. TPW 1.5 and printers

8. outputting direct to printer instead of screen - TPW 1.5

9. printer unit for TPW 1.5

10. Colors in TP 1.5

11. Bitmap -> colored ASCII

12. change colors in a bitmap


Powered by phpBB® Forum Software