delphi 颜色转换成 HTML 颜色代码


本文整理自网络,侵删。

 TColor to HTML color (颜色转换成 HTML 颜色代码)
TColor to HTML color
From Zarko Gajic,
Your Guide to Delphi Programming.
FREE Newsletter. Sign Up Now!
Put a TColorDialog (ColorDialog1), a TLabel (Label1) and a TButton (Button1) in your form, and assign the Button1.OnClick procedure as follows:
~~~~~~~~~~~~~~~~~~~~~~~~~
procedure TForm1.Button1Click(Sender: TObject) ;

function ColorToHtml(DColor:TColor):string;
var
tmpRGB : TColorRef;
begin
tmpRGB := ColorToRGB(DColor) ;
Result:=Format('#%.2x%.2x%.2x',
[GetRValue(tmpRGB),
GetGValue(tmpRGB),
GetBValue(tmpRGB)]) ;
end; {function ColorToHtml}

begin
if ColorDialog1.Execute then
Label1.Caption:=ColorToHtml(ColorDialog1.Color) ;
end;

相关阅读 >>

Delphi获取系统字体列表

winapi 字符及字符串函数(4): charupperbuff - 把缓冲区中指定数目的字符转大写

Delphi 在运行时改变控件的大小

Delphi怎么实现一定范围内的随机数呢?

Delphi文本文件读写

Delphi 利用unigui中的tunipagecontrol实现多页面

Delphi 从数组中任取一个

Delphi释放内存一般这么写

Delphi窗口显示和关闭的时候出现动画效果

Delphi 获取jpg文件宽度高度的方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...