C语言图像函数库详解docxWord下载.docx
- 文档编号:15853578
- 上传时间:2022-11-16
- 格式:DOCX
- 页数:13
- 大小:20.49KB
C语言图像函数库详解docxWord下载.docx
《C语言图像函数库详解docxWord下载.docx》由会员分享,可在线阅读,更多相关《C语言图像函数库详解docxWord下载.docx(13页珍藏版)》请在冰豆网上搜索。
Lineto()drawalinefunction
Linerel()relativetothelinefunction
Setlinestyle()
setsthelinefunction
Getlinesettings
()getsthelinesettingfunction
Setwritemocle()
setsthelinemodefunction
(3)thepolygon
function
Rectangle()rectanglefunction
Thebar()drawafunction
Bar3d()drawthebarfunction
Drawpoly()drawsapolygonfunction
(4),circle,arcandcurvefunction
Getaspectratio()obtainstheaspectratiofunction
Circle()circlefunction
Arc()todrawthearcfunction
Ellipse()drawstheellipticarcfunction
Fillellipse()drawstheellipticfunction
Thepieslice()drawingsectorfunction
Sector()drawstheellipticalsectorfunction
Thegetarccoords()getsthearccoordinatefunction
(5)thefillingfunction
Setfillstyle()setsthefillpatternandcolorfunction
Setfillpattern()setstheuser'
spatternfunction
Floodfill()fillsthecloseddomainfunction
Fillpoly()fillsthepolygonfunction
Getfillsettings()getsthefillsetfunction
Getfillpattern()getstheuser'
spatternsettingfunction
(6)theimagefunction
Theimagesize()imagestoresthesizefunction
Getimage()savestheimagefunction
Theputimage()outputimagefunction
4,graphicsandimagefunctions
Formanygraphicalapplications,linesandcurvesareveryuseful.Butsomegraphicscanonlybedrawnbymanipulatingindividualpixels・Ofcourse,ifyoudon'
tdrawpixels,youcan,toperatethelineandthefunctionofthecurve・Andbyusingpixelsonalargescale,theentireimagecanbesaved,written,erased,andstackedwiththeoriginalgraphicsonthescreen.
Putpixel()drawsthepixelfunction
Function:
thefunctionputpixel()drawsapixelonthescreeninthegraphicalmode・
Usage:
thefunctioniscalledvoidputpixel(intx,inty,intcolor);
Description:
parameterx,yisthecoordinatesofpixels,coloristhecolorofthispixel,itcanbethecolorsymbolname,alsocanbetheintegercolorvalue・
Thecorrespondingheaderfileforthisfunctionisgraphics・h
Returnvalue:
no
Example:
drawaredpixelonthescreen(6,8):
Putpixel(6,&
RED);
functiongetpixel()returnsapixelcolorvalue・
thisfunctioniscalledintgetpixel(intx,inty);
parameterx,yispixelcoordinates・
Thereturnvalueofthefunctiondoesnotreflecttheactualcolorvalue,dependingonthesettingofthepalette(seethesetpalette()function)・
Thecorrespondingheaderfileforthisfunctionisgraphic・h
returnapixelcolorvalue・
colorthepixelcolorofthe(8,6)dotonthescreen.
Color二getpixel(8,6);
Therearethreefunctionsthatdrawaline,namelyline(),lineto(),linerel()・Theselinesusingintegercoordinates,andrelativetothecurrentviewportgraphic,butnotbeinglimitedbytheviewport,ifviewportcuttingmarksclipistrue,thenthelinewillbeviewportmargintruncate;
Iftheclipisfalse,thelineistruncatedtothescreenlimiteveniftheendpointcoordinatesorthenewcurrentlocationareoutsidethevisualorscreenlimits・
Therearetwolineswideandseverallinestochoosefrom,oryoucandefinethelinepatternyourself・Thefollowingarethelinesandthelines・
line()USESthecurrentdrawingcolor,lineandlinewidth,drawingastraightlinebetweenthetwopoints・
thisfunctioniscalledvoidline(intstartx,intstarty,intendx,intendy);
parameterstartx,startyasastartingpointcoordinates,endx,endyascoordinates,before,duringandafterthefunctioncallgraphicsscreencursor(generallynotvisible)underthecurrentpositiondoesnotchange・
seetheexampleinthefunction60.Linerel()・
lineto()USESthecurrentdrawingcolor,lineandlinewidth,drawingalinefromthecurrentpositiontothespecifiedlocation.
thisfunctioniscalledvoidlineto(intx,inty);
Note:
theparameterx,yisthecoordinateofthespecifiedpoint,andafterthefunctioncall,thecurrentpositionchangestothespecifiedpoint(x,y)・
thefunctionlinerel()USESthecurrentdrawingcolor,lineandlinewidth,startingatthecurrentpositionanddrawingastraightlinefromthespecifiedhorizontalandverticaloffs
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 语言 图像 函数库 详解 docx
