📄 sdlfillrect.html
字号:
<HTML><HEAD><TITLE>SDL_FillRect</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="SDL Library Documentation"HREF="index.html"><LINKREL="UP"TITLE="Video"HREF="video.html"><LINKREL="PREVIOUS"TITLE="SDL_BlitSurface"HREF="sdlblitsurface.html"><LINKREL="NEXT"TITLE="SDL_DisplayFormat"HREF="sdldisplayformat.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFF8DC"TEXT="#000000"LINK="#0000ee"VLINK="#551a8b"ALINK="#ff0000"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">SDL Library Documentation</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="sdlblitsurface.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sdldisplayformat.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SDLFILLRECT"></A>SDL_FillRect</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN2351"></A><H2>Name</H2>SDL_FillRect -- This function performs a fast fill of the given rectangle with some color</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN2354"></A><H2>Synopsis</H2><DIVCLASS="FUNCSYNOPSIS"><ANAME="AEN2355"></A><P></P><PRECLASS="FUNCSYNOPSISINFO">#include "SDL.h"</PRE><P><CODE><CODECLASS="FUNCDEF">int <BCLASS="FSFUNC">SDL_FillRect</B></CODE>(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color);</CODE></P><P></P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN2361"></A><H2>Description</H2><P>This function performs a fast fill of the given rectangle with<TTCLASS="PARAMETER"><I>color</I></TT>. If <TTCLASS="PARAMETER"><I>dstrect</I></TT>is <TTCLASS="LITERAL">NULL</TT>, the whole surface will be filled with<TTCLASS="PARAMETER"><I>color</I></TT>.</P><P>The color should be a pixel of the format used by the surface, andcan be generated by the<AHREF="sdlmaprgb.html">SDL_MapRGB</A> or <AHREF="sdlmaprgba.html">SDL_MapRGBA</A>functions. If the color value contains an alpha value then thedestination is simply "filled" with that alpha information, no blendingtakes place.</P><P>If there is a clip rectangle set on the destination (set via<AHREF="sdlsetcliprect.html">SDL_SetClipRect</A>) then thisfunction will clip based on the intersection of the clip rectangle andthe <TTCLASS="PARAMETER"><I>dstrect</I></TT> rectangle and the dstrect rectanglewill be modified to represent the area actually filled.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN2374"></A><H2>Return Value</H2><P>This function returns <SPANCLASS="RETURNVALUE">0</SPAN> on success, or<SPANCLASS="RETURNVALUE">-1</SPAN> on error.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN2379"></A><H2>See Also</H2><P><AHREF="sdlmaprgb.html"><TTCLASS="FUNCTION">SDL_MapRGB</TT></A>,<AHREF="sdlmaprgb.html"><TTCLASS="FUNCTION">SDL_MapRGBA</TT></A>,<AHREF="sdlblitsurface.html"><TTCLASS="FUNCTION">SDL_BlitSurface</TT></A>,<AHREF="sdlrect.html"><SPANCLASS="STRUCTNAME">SDL_Rect</SPAN></A></P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="sdlblitsurface.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="index.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="sdldisplayformat.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">SDL_BlitSurface</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="video.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">SDL_DisplayFormat</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -