c语言image函数,C语言图像函数库详解(The C language image function library is detailed).doc...

本文详细介绍了C语言中的图像处理函数库,包括获取像素颜色值的getpixel()函数,以及用于绘制直线的line()、lineto()和linerel()函数。这些函数使用整数坐标,并考虑了视口裁剪。line()函数在两点间画直线,lineto()从当前位置到指定位置画线,linerel()则相对当前位置画线。了解这些函数对于进行C语言的图形编程至关重要。
摘要由CSDN通过智能技术生成

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值