Hallo,
ich habe das Problem, ein Bitmap auf den Drucker zu
kriegen, was auch mit nachfolgendem Code 'im Prinzip'
funktioniert, aber auf manchen Druckern (konnte bisher
kein System erkennen, hängt vielleicht mit GDI zusammen)
kommt nur eine leere Seite. Hier der verwendete Code,
den ich auf einem Forum (hier?) gefunden hatte und den
ich angpasst habe:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26:
| PROCEDURE PrintBitMap (img : TBitMap; Titel : STRING; PixPerInch : LONGINT; WieRum : TPrinterOrientation); VAR bmp : TBitmap; ScaleX, ScaleY : LONGINT; RR : TRect; op : TPrinterOrientation; BEGIN WITH Printer DO BEGIN bmp := TBitMap.Create; bmp := img; Title := Titel; op := Orientation; Orientation := WieRum; BeginDoc; TRY ScaleX := GetDeviceCaps (Handle,logPixelsX) DIV PixPerInch; ScaleY := GetDeviceCaps (Handle,logPixelsY) DIV PixPerInch; RR := Rect (0,0,bmp.Width * ScaleX,bmp.Height * ScaleY); Canvas.StretchDraw (RR,bmp); FINALLY EndDoc; END; Orientation := op; bmp.Free; END; END; |
Moderiert von
raziel: Delphi-Tags hinzugefügt