Solved

C to Delphi

Posted on 2004-03-22
5
212 Views
Last Modified: 2010-04-05
Hi,

Im converting some C++ code to delphi.

Can someone help with this please, Thanks


   x * := ((long)width);

   x / := fontWidth;

   x + := (AR_FIXED_POINT_PRECISION/2);

   x / := AR_FIXED_POINT_PRECISION;

   y * := ((long)height);

   y / := fontHeight;

   y + := (AR_FIXED_POINT_PRECISION/2);

   y / := AR_FIXED_POINT_PRECISION;

return(MAKELONG(x , y ));
0
Comment
Question by:smurff
  • 4
5 Comments
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 50 total points
ID: 10648200
x := x * width;
x := x / fontWidth;
x := x + (AR_FIXED_POINT_PRECISION / 2);
x := x / AR_FIXED_POINT_PRECISION;
y := y * height;
y := y / fontHeight;
y := y + (AR_FIXED_POINT_PRECISION / 2);
y := y / AR_FIXED_POINT_PRECISION;
Result := (x shl 16) + y;
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10648205
oops, change it to

Result := x + (y shl 16);
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10648206
coz MAKELONG is
#define MAKELONG(a, b) \
   ((LONG) (((WORD) (a)) | ((DWORD) ((WORD) (b))) << 16))
0
 
LVL 3

Author Comment

by:smurff
ID: 10648261
Thanks DraganSlayer.... Gee`s 11 minutes, what took you so long ;)
Thats what I love about EE, not only do you get an answer, you get one quicker than anywhere else.

Thanks again
Smurff
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 10649366
LoL, Erm... I'll try to trim it to 3 min next time ;-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi 10 Seattle Dataset Actions 5 79
How to fill array with TArray.Create? 14 79
Delphi Firemonkey Need Sample for Online Shopping Example. 2 120
Dev Express grid collapse 2 39
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now