#1 2020-11-29 00:27:20

douglaskeene
Member
Registered: 2013-04-19
Posts: 8

Coordinates

Hello
I am wondering what the coordinate units are for Canvas.Textout, etc. and how to set them, i.e., TextOut('Hello World', 600, 600) for DPI=600 at one inch...
Thank
Doug

Offline

#2 2020-11-29 10:08:24

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Coordinates

Which Canvas are you talking about?

The TPdfCanvas uses PDF units, and floating point coordinates of 72 pixels per inch. You can use PdfCoord() to compute the coordinate from mm.
There is no variable DPI in the PDF unit itself. It is always 72 pixels per inch. But since coordinates are floats it is not a problem.

The VCLCanvas is a standard VCL TCanvas. So here coordinates are integers, and you have the Canvas dimension in VCLCanvasSize property, and PageWidth/PageHeight properties in PDF units.

Offline

Board footer

Powered by FluxBB