C语言图像函数库详解(The C language image function library is detailed)
C语言图像函数库详解(The C language image function library is detailed)
Return value: returns a pixel point color value.
Example: assign the pixel color value of the screen (8, 6) to the variable color.
Color = getpixel (8, 6);
(2) linear and linear functions
There are three functions that draw a line, namely line (), lineto (), linerel (). These lines use integer coordinates and are not necessarily subject to the visual orifice of the current graph, but if the visual cut marks are true, the line will be cut off by the edge of the viewport. If the clip is false, the line truncates to the screen limit even if the endpoint coordinates or the new current position are outside of the graphical viewport or screen limit.
There are two lines wide and several lines to choose from, or you can define line drawings. The following are the linear and linear functions respectively.
Line () line function
Function: function line () USES the current drawing color, line and line width to draw a straight line between the two points.
Usage: this function is called void line (int startx, int starty, int endx, int endy).
Note: parameter startx, starty is the starting point, endx, endy is the endpoint coordinate, and before and after the function call, the screen cursor (generally not visible) is unchanged at the current position.
The corresponding header file for this function is graphics.h
Return value: none
Example: see the instance in function 60. Linerel ().
Lineto () draw a line function
Function: the function lineto () USES the current drawing color, linewidth and linewidth, and draws a line from the current position to the specified position.
Usage: this function is called void lineto (int x, int y).
Note: the parameter x, y is the coordinate of the specified point, and after the function call, the current position changes to the specified point (x, y).
The corresponding header file for this function is graphics.h
Return value: none
Example: see the instance in function 60. Linerel ().
60. L