Solved

D2: Pixel aspect ratio

Posted on 1997-08-25
3
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 50 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month6 days, 23 hours left to enroll

622 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