Einzelnen Beitrag anzeigen

Benutzerbild von Jazzman_Marburg
Jazzman_Marburg

Registriert seit: 2. Aug 2004
359 Beiträge
 
#1

GDI+: Image drucken

  Alt 11. Jul 2011, 19:23
Hallo zusammen!
Ich stehe gerade mal wieder auf dem Schlauch -- vielleicht könnt ihr helfen:
Ich habe mit GDI+ nun mein Image (gImage vom Typ IGPImage) fertig und möchte es nun drucken. Zu meiner GDI+ Library gibt es auch ein schönes Beispiel, wie man sowas bewerkstelligen könnte -- aber ich versteh das Demo-Beispiel nicht :
Delphi-Quellcode:
var
  PrinterGraphics: IGPGraphics;
  Pen: IGPPen;
begin
  Printer.BeginDoc;
  PrinterGraphics := TGPGraphics.Create(Printer.Handle);
  Pen := TGPPen.Create(TGPColor.Black);
  PrinterGraphics.DrawRectangle(Pen, 200, 500, 200, 150);
  PrinterGraphics.DrawEllipse(Pen, 200, 500, 200, 150);
  PrinterGraphics.DrawLine(Pen, 200, 500, 400, 650);
  Printer.EndDoc;
end;

Das Printer.Handle habe ich (PrintDialog) aber die anderen Zeilen zwischen Printer.BeginDoc und Printer.EndDoc sind mir unklar: mein gImage enthält doch schon das Bild, will ja nicht nochmal das Ganze Zeichnen-Geraffel ausführen, oder muß ich das?!
Das Demo sagt hierzu:
[I]"In the preceding code, the three GDI+ drawing commands are in between calls to the Printer.BeginDoc and Printer.EndDoc methods. All graphics commands between BeginDoc and EndDoc are routed to a temporary metafile. After the call to EndDoc, the printer driver converts the data in the metafile into the format required by the specific printer being used."[/I]

Verstehe nicht, was ich jetzt mit meinem fertigen gImage tun soll...

Jemand eine Idee?

Danke & Gruß
Jazzman
--- Delphi XE Starter, Windows 8 ---
  Mit Zitat antworten Zitat