Link to home
Start Free TrialLog in
Avatar of zhkhan
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
Avatar of cup
cup

What are POINTS?  It isn't a Win32 type.  

Where is it defined?  

What function is returning POINTS to you?
Avatar of zhkhan

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.
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.
ASKER CERTIFIED SOLUTION
Avatar of cup
cup

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
I think he means casting or some built in conversion function.
Avatar of zhkhan

ASKER

ya thats exactly what i meant.