Einzelnen Beitrag anzeigen

Sourceshare

Registriert seit: 23. Aug 2005
4 Beiträge
 
#7

Re: Das leidige Thema: "Drucken"

  Alt 15. Nov 2005, 15:00
you should change your method , don't use the Tpringdiag
please study:
GetDeviceCaps(Printer.Handle, LOGPIXELSX);
GetDeviceCaps(Printer.Handle, LOGPIXELSY);//GetPrint
Then use:
Printer.Canvas.StretchDraw(const Rect: TRect; Graphic: TGraphic);

Should be like this
var
DC: HDC;

dc := getdc(0);
with Printer do
try
....
R := Rect(0, 0, round(image1.picture.bitmap.width * GetDeviceCaps(Handle , HORZRES)/GetDevicecaps(dc, HORZRES)),round(image1.picture.bitmap.height * GetDeviceCaps(Handle, VERTRES)/GetDeviceCaps(dc,VERTRES)));
....

releasedc(0,dc);
  Mit Zitat antworten Zitat