Link to home
Start Free TrialLog in
Avatar of shaneholmes
shaneholmes

asked on

Printing TDrawGrid

I am trying to print a TDrawGrid, however, I cant seem to get it to print the actual size. Anyone know what I am doinf wrong?

See my code below:

Shane


 if PrintDialog1.Execute then
 begin
  Printer.BeginDoc;
  Printer.Orientation:= poLandscape;
  Grid.PaintTo(Printer.Handle, 10, 10);
  Printer.EndDoc;
 end;
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alanwhincup
alanwhincup

What you would have to do is modify the printers canvas with the Windows API: SetMapMode, SetViewportExtEx, SetViewportOrgEx, SetWindowExtEx, SetWindowOrgEx. Alternately you could PaintTo a bitmap first and then print that.

Cheers,

Alan
shaneholmes:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
shaneholmes,
No comment has been added lately (18 days), so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:

RECOMMENDATION: Award points to alanwhincup http:#7138372

Please leave any comments here within 7 days.

-- Please DO NOT accept this comment as an answer ! --

Thanks,

anAKiN
EE Cleanup Volunteer
i do not agree
i agree with you kretzschmar,
i used to use functions recommended by alanwhincup to print a grid, but now saw that it was other thread to do so, however, doing the same with some extension.
at first thought your answer is too general.

of course your right was to post an objection and thank you for that.
the recommendation will be changed of course.