Solved

C to Delphi

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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