Autor Beitrag
Tana´Ri
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Di 06.04.04 09:32 
Hi Leute,

ich versuche jetzt schon ne weile Grafiken zu drucken, doch bei mir bleibt das Papier weiß.
Hab jetzt DrawIcon, DrawIconEx, Imagelist.draw, Printer.Canvas - Routinen versucht, aber
nix will. Ich hatte mal ne TListView Druckprozedur geschrieben wo auch nur eine, nämlich
ListView.SmallImageList.Draw(), funktionierte. Alle versuche mit StretchDraw oder über
Umwege von Instanzen (aus Liste in Bitmap -> print bitmap) funktionierten auch nicht.
Das muss doch irgendwie gehn !?! :roll:

_________________
mfg
Tana´Ri
PhilGo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 315

Win 98, Win Longhorn ;-)

BeitragVerfasst: Di 06.04.04 16:00 
Hi Tana'Ri,
diese Problem hatte und hab ich auch.
Ich hab versucht ein Bild aus einer TImage zu drucken, aber nix hat funktioniert.
Mir hat jemand geraten:
ausblenden Delphi-Quelltext
1:
2:
3:
Printer.BeginDoc; 
Printer.Canvas.CopyRect(Rect(0, 0, Img_Wurf.Width, Img_Wurf.Height), Img_Wurf.Canvas, Rect(0, 0, Img_Wurf.Width, Img_Wurf.Height)); 
Printer.EndDoc;

zu versuchen. Aber dies funktioniert bei mir auch net.
Vielleicht klappt es bei dir. :roll:


Mfg PhilGo

_________________
Sie werden dich finden und töten... Söhne der großen Bärin!
Tana´Ri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Mi 07.04.04 11:54 
also ich habs jetzt hinbekommen, verwende Canvas.StretchDraw, wobei ich bezweifel das die Prozedure eine Rolle spielt, scheint nur mit Bitmaps einwandfrei zu funktioniern [Icons willl er nicht drucken :twisted:]

_________________
mfg
Tana´Ri
PhilGo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 315

Win 98, Win Longhorn ;-)

BeitragVerfasst: Do 08.04.04 11:20 
Ich hab es mit Canvas.Stretchdraw probiert, aber es klappt nicht.
Kannst du mir mal deinen Quelltext geben?

Mfg PhilGo

_________________
Sie werden dich finden und töten... Söhne der großen Bärin!
Tana´Ri Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 230



BeitragVerfasst: Do 08.04.04 12:23 
Hi,

hmm, der Code wär ein bissel groß hab mir auch nen Nachfahren von TPrinter abgeleitet ... aber die entsprechende Zeile kann ich dir durchaus zeigen, wobei ich allerdings bezweifel das es dir viel bringt.

Ich erzeuge eine TBitmap und lade dies dann in meine Instanz:

ausblenden Delphi-Quelltext
1:
2:
TablePrintJob.Column[s].CellIcon[z] := TBitMap.Create;
TablePrintJob.Column[s].CellIcon[z].LoadFromFile('Dummy.bmp');


Welche Art von Grafik willst du denn drucken ? (Bitmaps?)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
[...]
Printer.Canvas.StretchDraw(Rect(tx,ty,tx+IWidth,ty+IWidth),TablePrintJob.Column[s].CellIcon[z]); // CellIcon ist nicht mehr TIcon sondern TBitmap
// sollte ebenfalls für Draw gelten
[...]






Wobei diese Variante auch funktionieren muesste (ging mal):
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
// TImage
Printer.Draw(x,y,Image);
// TImageList
ImageList.Draw(Printer.Canvas,x,y,Index,IsColorPrinter(PrinterHandle));

// Falls benötigt:
// FUNCTION IsColorPrinter(hPrinter: THandle): Boolean;
//  begin
//   result := GetDeviceCaps(hPrinter,BITSPIXEL) * GetDeviceCaps(hPrinter,PLANES) = 1;
// end;

_________________
mfg
Tana´Ri
PhilGo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 315

Win 98, Win Longhorn ;-)

BeitragVerfasst: Fr 09.04.04 15:35 
Ich will Jpeg-Dateien drucken.

Aber mit deiner Hilfe hab ich es jetzt hinbekommen. :dance:
Ich danke dir für den Quelltext, der mir die nötigen Infos gegeben hat. :D


Mfg PhilGo

_________________
Sie werden dich finden und töten... Söhne der großen Bärin!