Board index » cppbuilder » Printing of bitmap images in Windows98

Printing of bitmap images in Windows98

hello ...

I have a problem printing bitmaps and the problem only exists in Windows98
(tested on different systemet, different hardware configurations and
different printers).

When I print a bitmap the result is a bitmap with a pattern of boxes
across - making the image completly useless.

I do this :

Graphics::TBitmap *bmp = new Graphics::TBitmap;

  Printer()->BeginDoc();
  try
  {
    TRect rect;
     bmp->LoadFromFile( String(x+1)+".bmp" );
     bmp->HandleType = bmDIB;

     rect = TRect( (float)(x)*1000+100,
                      (float)(x)*1000+100,
                      (float)(x+1)*1000+100,
                      (float)(x+1)*1000+100 );
     Printer()->Canvas->StretchDraw(rect, bmp );

     Printer()->Canvas->Pen->Color = clBlack;
     Printer()->Canvas->Brush->Color = clBlack;
     Printer()->Canvas->FrameRect(rect);

    Printer()->EndDoc();
  }
  catch(...)
  {
      Printer()->Abort();
  }

I suspect the scaling in the StretchDraw-method to cause this problem - but
I am not sure!

I use Borland C++Builder4 with the two service packs installed.

Any help is appreciated!

Flemming Knudsen, email : flemm...@mikrov.dk

 

Re:Printing of bitmap images in Windows98


Quote
Flemming Knudsen <flemm...@mikrov.dk> wrote in message

news:3ba60544_2@dnews...

Quote
> I have a problem printing bitmaps and the problem only exists in Windows98
> (tested on different systemet, different hardware configurations and
> different printers).

Perhaps your win98 has some settings different. Have you tried on many win98
machines, or just one?
Also, maybe not important, but check wheter your display on win98 is set to
24-bit color, a what is it set to on other OSs.

Quote
> I suspect the scaling in the StretchDraw-method to cause this problem -
but
> I am not sure!

You can clear your doubts by printing unstreched picture ... see if it gets
distorted too.

Other Threads