Solved

Print Pixel scale (200 Pts)

Posted on 1999-01-26
2
162 Views
Last Modified: 2010-04-06
Hi, you might answer this question in "How to print a StringGrid", where you will get 200 pts

I'm doing some textout to the printer.canvas, and having trouble specifing the y-offset for the next line. I'm printing from a stringgrid, and I thought that the rowheight could be the y-offset but on the printer.canvas this value must be around 2.5 larger or the lines are drawed on top of each other.
How to I get this const to multiply with stringgrid.rowheight, I sure it changes from printer to printer, depending on the paper and printer resolution.
0
Comment
Question by:koger
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 0 total points
ID: 1363420
Hi koger,

As I understand your question, then your looking for the difference of pixels between screen and printer? Correct?

If so, this should be a solution :

XPixelsPerInch := GetDeviceCaps(Printer.Handle, LOGPIXELSX);
YPixelsPerInch := GetDeviceCaps(Printer.Handle, LOGPIXELSY);

And screen.PixelsPerInch gives you the pixels per inch of your screen...

so devide these two and you get your constant...

or am I wrong?

Regards, Zif.
 
0
 

Author Comment

by:koger
ID: 1363421
You are right go ahead and answer the other question to get your 200 pts ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 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

24 Experts available now in Live!

Get 1:1 Help Now