[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

C to Delphi

Posted on 2004-03-22
5
Medium Priority
?
235 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
[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
  • 4
5 Comments
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 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