Autor Beitrag
Gagamba
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Do 29.06.06 16:58 
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:


ausblenden 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);
//          Canvas.Draw (0,0,bmp);         // druckt nur winziges Bitmäppelchen..
    FINALLY EndDoc;
    END;
    Orientation := op;
    bmp.Free;
  END;
END;


Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
FAlter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 192

Win XP Home
Turbo Delphi 2006 (Win32), C# (VS 2008 Prof.), Java (Eclipse), PHP
BeitragVerfasst: So 09.07.06 12:46 
Hi,

Weitere Problemdiskussion:
forum.dsdt.info/viewtopic.php?t=25730

Ein möglicher Lösungsansatz und Begründung:
homepages.borland.co...dex.html#PrintBitmap

Mfg
FAlter