Solved

Print Pixel scale (200 Pts)

Posted on 1999-01-26
2
164 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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