Printing a Bitmap on Printer has no output
I have a Bitmap that should be printed to the Printer canvas, but the Printer prints only empty pages (the Bitmap has Content, I have testet this).
If PrintDialog1.PrintRange = TPrintRange.prAllPages Then begin For x := 1 To MaxPage do begin FirstPrintPage := (x = 1); PrintPage(Scrollbox1.Bitmap.Canvas, x); // Here the Bitmap is filled with content Printer.Canvas.DrawBitmap (Scrollbox1.Bitmap, RectF (0,0,Scrollbox1.Bitmap.Width, Scrollbox1.Bitmap.Height), RectF (0,0, Printer.PageWidth, Printer.PageHeight), 1, false); if x < MaxPage then Printer.NewPage; end; end
Comments (9)
-
reporter -
repo owner Actually we have an issue with testing on real printer on Linux, we are working on workaround. We tested by Print To File and Print to VM Host Printer. Bitmap drawing works good for us. Can you check Print To File ? ? In order to understand where is an issue.
-
reporter - attached Project77.zip
-
reporter When printing to a file it will be directed to the real printer, with an output of empty pages. Drawing text to the Printer.canvas has also no effect.
Other programs (e.g. gEdit) are working as expected.
On Windows and mac all is good.
Try the attachment by yourself...
-
repo owner - changed status to resolved
0.99k
-
reporter I'm sorry, but it is not solved. And additionally I get a Segmentation fault, when I call "Execute"-Function of PrintDialog, see attached Screenshot (Version 0.99k).
-
reporter - attached Bild-53CAA1B4-F9F.jpg
-
reporter - changed status to open
-
reporter - changed status to resolved
- Log in to comment
Additional Info: This works under Windows and mac, but not on Linux:
if Ziel <> Printer.Canvas then begin Ziel.BeginScene; ziel.Clear (TAlphaColorRec.white); Ziel.EndScene; {$ENDREGION} end; The Bitmap has no White Background.