Solved

Printing TDrawGrid

Posted on 2002-07-07
6
275 Views
Last Modified: 2010-04-04
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;
0
Comment
Question by:shaneholmes
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 7136968
instead of
Grid.PaintTo(Printer.Handle, 10, 10);

use
Grid.PaintTo(Printer.Canvas.Handle, 10, 10);
 
just a guess

meikl ;-)
0
 
LVL 5

Expert Comment

by:alanwhincup
ID: 7138372
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
0
 

Expert Comment

by:CleanupPing
ID: 9343096
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.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9460267
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
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9460316
i do not agree
0
 
LVL 5

Expert Comment

by:Lukasz Lach
ID: 9460740
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now