zhkhan
asked on
Polygon using POINTS
Polygon API require POINT* and i have POINTS*. what is the best way to solve this issue? are there a way to convert between both types in one step without looping through all the points? also i searched for Polygon API that accept POINTS*, but i got nothing.
thanks
thanks
ASKER
POINTS are defined in windef.h, as the following:
typedef struct tagPOINTS
{
#ifndef _MAC
SHORT x;
SHORT y;
#else
SHORT y;
SHORT x;
#endif
} POINTS, *PPOINTS, *LPPOINTS;
i am working in wince and trying to save memory, because my points count is huge, so prefer to use short instead of long for both x and y.
typedef struct tagPOINTS
{
#ifndef _MAC
SHORT x;
SHORT y;
#else
SHORT y;
SHORT x;
#endif
} POINTS, *PPOINTS, *LPPOINTS;
i am working in wince and trying to save memory, because my points count is huge, so prefer to use short instead of long for both x and y.
I think there isn't, and it can't exist.
POINT and POINTS are different structures, so if you want to use a POINT you must convert it to POINTS. the loop is the only choice.
POINT and POINTS are different structures, so if you want to use a POINT you must convert it to POINTS. the loop is the only choice.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What do you mean in one step? You need to make a function that will convert your type into an array of POINT. It is a loop. You can use for example, vector from STL and use an algorithm, for example, for_each.
http://msdn.microsoft.com/en-us/library/c4x1w65f(VS.80).aspx
http://support.microsoft.com/kb/156345
http://msdn.microsoft.com/en-us/library/c4x1w65f(VS.80).aspx
http://support.microsoft.com/kb/156345
I think he means casting or some built in conversion function.
ASKER
ya thats exactly what i meant.
Where is it defined?
What function is returning POINTS to you?