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;

相关阅读 >>

incsecond:将一个tdatetime变量加减一定数量的秒数

Delphi 如何读取内存中的数据?

Delphi判断某一个点是否在一个区域内

Delphi 在xp/2k 下实现 win+ctrl+del 等键的屏蔽的方法

Delphi里树形菜单的实现

Delphi strtodatetime 这个函数在win7下出错

Delphi获取操作系统安装磁盘盘符

Delphi 生成并替换txt里的内容

Delphi应用程序的调试(1-10)

Delphi tdirectory

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



打赏

取消

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

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

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

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

评论

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