📄 sdldisplayformatalpha.html
字号:
<HTML><HEAD><TITLE>SDL_DisplayFormatAlpha</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_DisplayFormat"HREF="sdldisplayformat.html"><LINKREL="NEXT"TITLE="SDL_WarpMouse"HREF="sdlwarpmouse.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="sdldisplayformat.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="sdlwarpmouse.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="SDLDISPLAYFORMATALPHA"></A>SDL_DisplayFormatAlpha</H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN2432"></A><H2>Name</H2>SDL_DisplayFormatAlpha -- Convert a surface to the display format</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN2435"></A><H2>Synopsis</H2><DIVCLASS="FUNCSYNOPSIS"><ANAME="AEN2436"></A><P></P><PRECLASS="FUNCSYNOPSISINFO">#include "SDL.h"</PRE><P><CODE><CODECLASS="FUNCDEF">SDL_Surface *<BCLASS="FSFUNC">SDL_DisplayFormatAlpha</B></CODE>(SDL_Surface *surface);</CODE></P><P></P></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN2442"></A><H2>Description</H2><P>This function takes a surface and copies it to a new surface of thepixel format and colors of the video framebuffer plus an alpha channel,suitable for fast blitting onto the display surface. It calls<AHREF="sdlconvertsurface.html">SDL_ConvertSurface</A></P><P>If you want to take advantage of hardware colorkey or alpha blitacceleration, you should set the colorkey and alpha value beforecalling this function.</P><P>This function can be used to convert a colourkey to an alpha channel,if the <TTCLASS="LITERAL">SDL_SRCCOLORKEY</TT> flag is set on the surface.The generated surface will then be transparent (alpha=0) where thepixels match the colourkey, and opaque (alpha=255) elsewhere.</P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN2449"></A><H2>Return Value</H2><P>If the conversion fails or runs out of memory, it returns<SPANCLASS="RETURNVALUE">NULL</SPAN></P></DIV><DIVCLASS="REFSECT1"><ANAME="AEN2453"></A><H2>See Also</H2><P><AHREF="sdlconvertsurface.html">SDL_ConvertSurface</A>,<AHREF="sdlsetalpha.html">SDL_SetAlpha</A>,<AHREF="sdlsetcolorkey.html">SDL_SetColorKey</A>,<AHREF="sdldisplayformat.html">SDL_DisplayFormat</A>,<AHREF="sdlsurface.html">SDL_Surface</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="sdldisplayformat.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="sdlwarpmouse.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">SDL_DisplayFormat</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="video.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">SDL_WarpMouse</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -