APIDb_​CoordToPointID

Convert a model coordinate to screen in the current database.

    GSErrCode ACAPI_Database (
        APIDb_CoordToPointID,
        API_Coord*     coord,
        API_Point*     point
    );

 

Parameters

[in] coord
the coordinate to convert
[out] point
the associated screen coordinate

 

Return Values

NoError
The function has completed with success.
APIERR_BADPARS
any of the parameters are nullptr.

For other common API errors see the API Errors document.

 

Remarks

This function is used to determine the pixel of a real coordinate.

It is the inverse function of APIDb_PointToCoordID function. Note that different coordinates may be assigned to the same pixel. The conversion mainly depends on the window size, on the actual drawing scale and zoom settings (APIDb_GetDrawingScaleID, APIDb_GetZoomID) which means the projection is database dependent.

 

Example


API_Coord    c;
API_Point    p
GSErrCode    err;

c.x = 1.0;
c.y = 2.0;
err = ACAPI_Database (APIDb_CoordToPointID, &c, &p);
err = ACAPI_Database (APIDb_PointToCoordID, &p, &c);

 

Requirements

Version: API 4.1 or later
Header: APIdefs_Database.h

 

See Also

API_Coord, API_Point, APIDb_PointToCoordID,
ACAPI_Database, API Functions