Autor Beitrag
galagher
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Do 26.08.04 18:16 
Hallo!

Melde mich schon wieder mit einem Problem:
Weiss jemand, warum zum Teufel der Drucker zwar druckt, wenn der Code unter "if RadioButton1.Checked", aber nicht, wenn der Code unter "if RadioButton2.Checked" ausgeführt wird? Image1 wird jeweils grössenmässig verändert. Wo ist da mein Fehler? Hier der Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
  Printer.BeginDoc;
 SetMapMode(Printer.Canvas.Handle, MM_LOMETRIC);

 if RadioButton1.Checked then
//  Printer.Canvas.CopyRect(Rect(413, 0, 818, -818),
//Edit: Richtig ist hier:
  Printer.Canvas.CopyRect(Rect(41301644, -1231),
   Image1.Canvas, Rect(00, Image1.Width, Image1.Height));

 if RadioButton2.Checked then
  Printer.Canvas.CopyRect(Rect(001450, -1202),
   Image1.Canvas, Rect(00, Image1.Width, Image1.Height));

 Printer.EndDoc;


Danke!!!

//Edit: Leute, vergesst es! Es liegt offenbar an Image1.Width oder so, denn mit einem anderen TImage klappts! Sorry, hätte ich vorher testen sollen!

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Do 26.08.04 19:29 
Geb dir aber trotzdem nen Tipp:
Die GDI-API hat Probleme mit Grafiken wo X1*Y1 > ein bestimmter Wert ist. Siehe Delphi-Hilfe für die genauen Begrenzungen. Zu lösen geht das Problem, indem du immernur einzelne Teile kopierst, die unter dieser Grenze liegen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
galagher Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2562
Erhaltene Danke: 46

Windows 10 Home
Delphi 10.1 Starter, Lazarus 2.0.6
BeitragVerfasst: Do 26.08.04 21:19 
BenBE hat folgendes geschrieben:
Geb dir aber trotzdem nen Tipp:
Die GDI-API hat Probleme mit Grafiken wo X1*Y1 > ein bestimmter Wert ist.


Danke für deine Antwort! Der Wert ist 32767, ich werde aber in jedem Fall diese Grenze nicht erreichen, aber gut zu wissen!

_________________
gedunstig war's - und fahle wornen zerschellten karsig im gestrock. oh graus, es gloomt der jabberwock - und die graisligen gulpen nurmen!