LineDDA

Syntax

void LineDDA(X1,Y1,X2,Y2,lpLineFunc,lpData)

This function computes all successive points in a line starting at the point specified by the X1 and Y1 parameters and ending at the point specified by the X2 and Y2 parameters.

The endpoint is not included as part of the line. For each point on the line, the LineDDA function calls the application-supplied function pointed to by the lpLineFunc parameter, passing to the function the coordinates of the current point and the lpData parameter.

Parameter Type/Description  

X1 int Specifies the logical x-coordinate of the first point.  
Y1 int Specifies the logical y-coordinate of the first point.  
X2 int Specifies the logical x-coordinate of the endpoint.  
Y2 int Specifies the logical y-coordinate of the endpoint.  
lpLineFunc FARPROC Is the procedure-instance address of the application-supplied function. See the following “Comments” section for details.  
lpData LPSTR Points to the application-supplied data.  

Return Value

None.

Comments

The address passed by the lpLineFunc parameter must be created by using the MakeProcInstance function.

The callback function must use the Pascal calling convention and must be declared FAR.

Callback Function

void FAR PASCAL LineFunc(X, Y, lpData)
int X;
int Y;
LPSTR lpData;

LineFunc is a placeholder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the application's module-definition file.

Parameter Definition  

X Specifies the x-coordinate of the current point.  
Y Specifies the y-coordinate of the current point.  
lpData Points to the application-supplied data.  

Return Value

The function can perform any task. It has no return value.