Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

D2: Pixel aspect ratio

Posted on 1997-08-25
3
Medium Priority
?
461 Views
Last Modified: 2010-04-06
How do i obtain the pixel aspect ratio (its physical height vs width in millimeters) in Delphi 2
0
Comment
Question by:gk082597
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1342389
try this, e.g.

const INCHES_PER_MILIMETER : Real  = 0.04;

....

var PixX, PixY : integer;
    PixPerMMX, PixPerMMY : real;
    AspectRatio : real;

PixX := GetDeviceCaps({Device Context}, LOGPIXELSX);
PixY := GetDeviceCaps({Device Context}, LOGPIXELSY);

PixMMX := INCHES_PER_MILIMETER * PixX;
PixMMY := INCHES_PER_MILIMETER  * PixY;

AspectRatio := PixMMY/PixMMX;
....


{Device Context} e.g. Printer.Handle

From Delphi help :

The GetDeviceCaps function retrieves device-specific information about a specified device.

int GetDeviceCaps(

    HDC  hdc,      // device-context handle
    int  nIndex       // index of capability to query  
   );

hdc

Identifies the device context.

nIndex

Specifies the item to return. This parameter can be one of the following values: I recommend you should look at these!!!!

Have fun,
c.u. ZifNab;
0
 

Author Comment

by:gk082597
ID: 1342390
It workt just fine. Thanks
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1342391
Glad I could help.

Have fun,
c.u. BanZif;
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

916 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