Autor Beitrag
MGKV
Hält's aus hier
Beiträge: 5

Windows XP Prof
Delphi 7 Prof
BeitragVerfasst: Sa 15.07.06 16:07 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure PrintBitmap(aGraphic: TGraphic, Title: string);
begin
  Printer.Title:=Title;
  Printer.BeginDoc;
  Printer.Canvas.Draw(0,0,aGraphic);
  Printer.EndDoc;
end;

procedure TMainForm.Button1Click(Sender: TObject);
begin
PrintBitmap(TJPEGImage,'Test');
end;


Warum geht das nicht? Was mache ich falsch?

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: So 16.07.06 09:07 
Hallo, es würde uns helfen, wenn du auch sagst, was nicht geht.

Dein code sieht nicht wie Pseudocode aus, trotzdem hat er viele Fehler:
ausblenden Delphi-Quelltext
1:
procedure PrintBitmap(aGraphic: TGraphic ; Title: string);  //Semikolon statt komma					


ausblenden Delphi-Quelltext
1:
PrintBitmap(JPEGImage,'Test'); //das T muß weg					


Ansonsten wäre ich mir nicht sicher, ob du ein Jpegimage als Tgraphic übergeben kannst und das canvas.draw damit klar kommt -> evtl vorher in ein Bmp umwandeln
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure PrintJpeg(aJpeg: TJpegimage; Title: string);  
Var bmp:Tbitmap;
begin  
  bmp:=tbitmap.create;
  try
    bmp.assign(ajpeg);
    Printer.Title:=Title;  
    Printer.BeginDoc;      
    Printer.Canvas.Draw(0,0,bmp);  
    Printer.EndDoc;  
  finally
    bmp.free;
  end;
end;


mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)