Solved

C to Delphi

Posted on 2004-03-22
5
208 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

16 Experts available now in Live!

Get 1:1 Help Now