click on different resolution

how can I click a coordinate in different resolutions?
example I have coordinated 800x600 want more picks coordinated in 1024x800 resolution?
skiuiaAsked:
Who is Participating?
 
Sinisa VukConnect With a Mentor Commented:
Something like this....
function GetScaledViewPoint(MousePt: TPoint; rScreenSizeOrg, rScreenSizeDest: TSize): TPoint;
begin
  Result.X := MulDiv(MousePt.X, rScreenSizeDest.cx, rScreenSizeOrg.cx);
  Result.Y := MulDiv(MousePt.Y, rScreenSizeDest.cy, rScreenSizeOrg.cy);
end;
....

pt := GetScaledViewPoint(Types.Point(14,356), Types.Point(800,600), Types.Point(1024,800));

Open in new window

0
 
skiuiaAuthor Commented:
[DCC Error] Unit1.pas(38): E2010 Incompatible types: 'tagSIZE' and 'TPoint'
0
 
Sinisa VukCommented:
Sorry this is just example of calling in one line. You can use variables of Tsize type or use typecast.

pt := GetScaledViewPoint(Types.Point(14,356), TSize(Types.Point(800,600)), TSize(Types.Point(1024,800)));

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.