📄 dtcolor.html
字号:
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta NAME="Author" CONTENT="Fu Gui">
<meta NAME="GENERATOR" CONTENT="Mozilla/4.01 [en] (Win95; I) [Netscape]">
<title>如何取的系统颜色数</title>
</head>
<body BACKGROUND="bk379.gif" tppabs="http://www.nease.net/~borland/bgimage/bk379.gif" NOSAVE>
<h1>
Delphi中如何取得系统支持的颜色数</h1>
<p> 在自己的软件中经常需要得知运行本软件的系统支持的颜色数。例如有的软件在16Bits的颜色数的计算机上开发而成,程序的颜色调试得非常漂亮,但是到了一台只支持16色的计算机上,程序变得非常难看。这就需要得到系统的颜色数。
<br> Delphi中如何取得系统的颜色数呢?下面的程序就解决这个问题。
<p>function GetSysColorNum:Integer;
<br>Var
<br> ScreenDc:HDC;
<br> NumBitsPixel:Integer;
<br>begin
<br> Result:=0;
<br> ScreenDc:=GetDC(0);
<br> NumBitsPixel:=GetDeviceCaps(ScreenDc,BITPIXEL);
<br> ReleaseDC(ScreenDC);
<br> Result:=1 shl NumBitsPixel;
<br>End;
<p>如果大家有更好的方法,请来信告之,谢谢。如果上面有不对之处,请不吝指教,谢谢。
<p>作者:<a HREF="mailto:fgui@usa.net">傅贵</a>
<table cellpadding="0" border="0" cellspacing="0">
<tr><td><a href="tppmsgs/msgs0.htm#4" tppabs="http://www.linkunion.com/" target="linkun">
<img src="lu.gif" tppabs="http://www.linkunion.com/gif/lu.gif" width="40" height="40" border="1" alt="LU"></a></td><td>
<a href="tppmsgs/msgs0.htm#7" tppabs="http://www.linkunion.com/cgi-localbin/goto.pl?n1535:015" target="linkun">
<img src="ads.pl-n1535-015" tppabs="http://www.linkunion.com/cgi-localbin/ads.pl?n1535:015" alt="LinkUnion Free Advertising Network" width="400" height="40" border="1"></a></td></tr>
<tr><td border="1" colspan="2"><center><font size="-1"><a href="tppmsgs/msgs0.htm#4" tppabs="http://www.linkunion.com/" target="linkun">Member of LinkUnion - Click Here to Join</center></a></font>
</td></tr></table>
<br>最后修改日期:98.3.15
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -