VI10AddArc2
V = Vector
I = Image
Function that is used to manage the Vector Image feature (object that resides on some Qpaint versions).
The VI10AddArc2 function dds the ARC2 command queued to be processed in the Buffer instructions to perform the drawing.
The ARC2 command trace an arc of type II or IV (see drawing in notes) current coordinates to X and Y coordinates passed through the function.
The X and Y coordinates are also set, at end of statement, as current coordinates.
Buffer |
IMPLEMENTATION
VI10AddArc2 (awBuffer, Coord_X, Coord_Y, Radius)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
IN | ARRSYS / ARRGBL | awBuffer | W | Array that serves as a buffer for instructions/data |
IN | CONST/ GLOBAL | Coord_X | W | Variable containing the value of the X coordinate of the end point of arc, within the Vector Image. |
IN | CONST/ GLOBAL | Coord_Y | W | Variable containing the value of the Y coordinate of the end point of arc, within the Vector Image. |
IN | CONST/ GLOBAL | Radius | W | Variable containing the value of the radius of the circle on which you want to draw the arc. |
Example
TASK_00
MAIN: VI10InitBuffer (awBuffer) ;Initializes the Buffer Color = 0 ;Sets the black color VI10AddPen (awBuffer, Color) ;Adds the PEN command Coord_X = 0 ;Sets the coordinates for the MOVE Coord_y = 0 VI10AddMove (awBuffer, Coord_X, Coord_Y) ;Adds the MOVE command Coord_X = 100 ;Sets the coordinates and the radius for ARC2 Coord_y = 50 Radius = 200 VI10AddArc2 (awBuffer, Coord_X, Coord_Y, Radius);Adds the ARC2 command .... WAIT 1 JUMP MAIN END
Note
-
Considered the picture below:
The circumference arc between point A and point B can be executed through one of the four trajectories I, II, III or IV. The ARC2 function execute the trajectories that belong to the circumference with the most “high” between the two (coordinate Y0 greater), then, in drawing, the circumference whit Center C1. This circumference can execute the trajectory II or the trajectory IV. The trajectory II is execute if you set a negative radius, while the trajectory IV is executed if you set a positive radius.
If you want to execute a cricumference arc It belongs to the circumference whose Center Co such as that represented by the trajectories I or III, you must use th ARC1e function, with which, by setting a negative radius, will be the I trajectory, while setting a positive radius will be the trajectory III.