Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi StrecthDraw (https://www.delphipraxis.net/175443-strecthdraw.html)

MarkSE 21. Jun 2013 10:29

StrecthDraw
 
Guten Tag Leute,
etwas mache ich sicherlich falsch und suche seit Tagen im Forum nach einer Lösung und fand viele Vorschläge, leider ohne Erfolg.
Bitte schaut Euch meine kleine Procedure an, warum bleibt das Papier immer weiß?
Vielen Dank für Eure Hilfe im Voraus.
(Ich benutze Delphi 7 Studio Professional, XP SPK3 , DELL LaserJet 1100)

Procedure PrintJPG;
var
lmgJPG: TJPEGImage;
b:TBitMap;
x:Trect;
begin
// JPEG-Bild bild1.jpg ist in Graustufen und 303 x 87 dpi groß
Printer.PrinterIndex := 0;
Printer.BeginDoc;
SetMapMode ( Printer.Canvas.Handle, MM_LOMETRIC); // auf mm einstellen

lmgJPG:= TJPEGImage.Create;
lmgJPG.LoadFromFile('c:\test\bild1.jpg');
b:= TBitmap.Create;
b.Assign(lmgJPG); // BildInfo steckt doch jetzt in b oder?
try
x.Left:=20; // auch 0, 0, 302, 86 ausprobiert, also ohne Stetch
x.Right:=500; // immer bleibt das Papier weiß
x.Top:=20;
x.Bottom:=500;

printer.canvas.stretchdraw(x,b); // Das Papier bleibt weiß
finally
FreeAndNil(b);
FreeAndNil(lmgJPG);
end;
Printer.EndDoc;
end;

DeddyH 21. Jun 2013 10:39

AW: StrecthDraw
 
Und wenn Du die Y-Koordinaten (X.Top und X.Bottom) auf negative Werte setzt?

MarkSE 21. Jun 2013 10:57

AW: StrecthDraw
 
Oh Mann
DaddyH, Du hast in 2 Minuten das gesehen, was ich vor 5 Tagen sehen sollte
Ich danke Dir, sehr.
LG Mark

DeddyH 21. Jun 2013 11:06

AW: StrecthDraw
 
Es steht im MSDN beschrieben:
Zitat:

MM_LOMETRIC

Each logical unit is mapped to 0.1 millimeter. Positive x is to the right; positive y is up.
:zwinker:


Alle Zeitangaben in WEZ +1. Es ist jetzt 23:11 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz