随笔 - 2146  文章 - 19 评论 - 11846 阅读 - 1267万

随笔分类 -  颜色操作及相关函数

关于位图的像素格式
摘要:1、判断位图的像素格式: var bit: TBitmap; pix: TPixelFormat; s: string; begin bit := TBitmap.Create; bit.LoadFromFile('c:\temp\test.bmp'); //位图路径 pix := bit.PixelFormat; s := ''; case pix of ... 阅读全文
posted @ 2008-12-01 14:08 万一 阅读(6304) 评论(8) 推荐(0) 编辑
根据颜色值获取颜色常量名: ColorToIdent
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ComCtrls; type TForm1 = class(TForm) Button1: TBut... 阅读全文
posted @ 2008-10-30 16:55 万一 阅读(3661) 评论(0) 推荐(0) 编辑
一行代码设置颜色的控件
摘要:本例效果图: 提示: 新建工程后, 添加 TColorBox、TColorListBox、TColorGrid、TButtonColor 四个控件, 分别双击它们建立默认事件, 然后贴入下面代码: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, ... 阅读全文
posted @ 2008-04-27 22:42 万一 阅读(4028) 评论(1) 推荐(0) 编辑
颜色选取 - 权当给 supperment 的回复吧, 你的要求要用到"种子算法", 我暂时还没算明白.
摘要:本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Button1: TButton; ... 阅读全文
posted @ 2008-03-21 15:47 万一 阅读(2698) 评论(3) 推荐(0) 编辑
颜色转换函数: 从 Delphi 到 Html
摘要:{由 Delphi 的颜色常数转换到 Html 颜色} function HexColorToHtmlColor(c: Integer): string; var R,G,B: Byte; begin R := c and $FF; G := (c shr 8) and $FF; B := (c shr 16) and $FF; Result := #35 + Format(... 阅读全文
posted @ 2008-02-19 15:08 万一 阅读(4789) 评论(2) 推荐(0) 编辑
Delphi 中的颜色常量及效果图
摘要:颜色名称 颜色效果 Hex HTML clBlack$000000#000000 clMaroon$000080#800000 clGreen$008000#008000 clOlive$008080#808000 clNavy$800000#000080 clPurple$800080#800080 clTeal$808000#008080 clGray$808080#808... 阅读全文
posted @ 2008-02-19 14:45 万一 阅读(30405) 评论(8) 推荐(4) 编辑
颜色表
摘要:颜色样本 十六进制 名称与注释 #ffb3a7粉红:即浅红色。别称:妃色 杨妃色 湘妃色 妃红色。 #ed5736妃色:妃红色。古同“绯”,粉红色。杨妃色、湘妃色、粉红皆同义。 #f00056品红:比大红浅的红色。 #f47983桃红:桃花的颜色,比粉红略鲜润的颜色。 #db5a6b海棠红:淡紫红色、较桃红色深一些,是非常妩媚娇艳的颜色。 #f20c00石榴红:石榴花的颜色,高色度和纯度... 阅读全文
posted @ 2007-12-25 00:29 万一 阅读(62995) 评论(2) 推荐(0) 编辑
TColorToHex 与 HexToTColor
摘要:function TColorToHex(Color: TColor): string; begin Result := IntToHex(GetRValue(Color), 2) + IntToHex(GetGValue(Color), 2) + IntToHex(GetBValue(Color), 2); end; function HexToTColor(sC... 阅读全文
posted @ 2007-12-12 02:43 万一 阅读(3210) 评论(7) 推荐(1) 编辑
RGBToHSB
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button... 阅读全文
posted @ 2007-12-12 02:22 万一 阅读(3686) 评论(2) 推荐(0) 编辑
Delphi 中的颜色
摘要://全以红色举例: //1. RGB 模式: Self.Color := $0000ff; //不过和HTML中的 #ff0000 是反的,应该叫 BGR。 //2. RGB 分值,譬如: Self.Color := RGB(255,0,0); //3. Delphi 中的标准模式: Self.Color := $000000ff; //其中低3位字节代表RGB(BGR)相应的颜色;... 阅读全文
posted @ 2007-12-08 12:37 万一 阅读(13077) 评论(1) 推荐(1) 编辑
TColor 与 RGB 的转换函数
摘要:function RGB2TColor(const R, G, B: Byte): Integer; begin // convert hexa-decimal values to RGB Result := R + G shl 8 + B shl 16; end; procedure TColor2RGB(const Color: TColor; var R, G, B: Byte... 阅读全文
posted @ 2007-11-22 15:38 万一 阅读(8898) 评论(3) 推荐(1) 编辑



点击右上角即可分享
微信分享提示