Sign in Join
Wiki copytemporary

Print Bitmap: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Print Bitmap

OldNewLine
1+## How to send an image to the printer
2+
3+``` pascal
4+// uses Printers;
5+var
6+ Scale :LongInt;
7+begin
8+ with Printer do
9+ begin
10+ BeginDoc;
11+ Scale := Min(
12+ Printer.PageWidth div Image1.Picture.Bitmap.Width,
13+ Printer.PageHeight div Image1.Picture.Bitmap.Height);
14+
15+ Printer.Canvas.StretchDraw(
16+ Rect(0, 0, Image1.Picture.Bitmap.Width*Scale, Image1.Picture.Bitmap.Height*Scale),
17+ Image1.Picture.Bitmap);
18+
19+ EndDoc;
20+ end;
21+end;
22+```
23+
24+---
25+*From the Free Pascal wiki, page "Print Bitmap", as it stood on 2020-02-23 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*

Back to history