Set DPI (VectorResolution) for ImageVectorOutput in mm

Just starting out? Need help? Post your questions and find answers here.
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Set DPI (VectorResolution) for ImageVectorOutput in mm

Post by Lebostein »

I draw on an Image in unit Millimeters. I can get the DPI with VectorResolutionX() and VectorResolutionY(). It seems the default DPI are 96. But how I can set the default DPI?
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Set DPI (VectorResolution) for ImageVectorOutput in mm

Post by freak »

The default DPI is the reported screen resolution.

The DPI setting is just a definition for how a length is converted to a pixel amount. You can easily change it by applying a scaling factor like so:

Code: Select all

; Scale so 1 inch will convert to 300 pixels 
ScaleCoordinates(300/VectorResolutionX(), 300/VectorResolutionY())
quidquid Latine dictum sit altum videtur
Post Reply