rgb(x,y,z):tcolor;或者integer;
begin
result:=x*256*256+y*256+z;
end
begin
result:=x*256*256+y*256+z;
end
解决方案 »
- 请高手帮忙,看看下面程序哪有错误啊?急死我了。(存储image图片的问题)
- 100分求:左右声道控制控件(要求2个音响都要有声音发出)
- 关于安装MSCOMM控件出现的问题有人知道吗?
- 高手请进!!!超难!!!!!!!
- 给MDI主窗口加背景时,总是出错,请大家进来看看吧!
- 神呀,救救我吧!(关于多表关联的设计问题)
- 如何在DirectX游戏中捕获键盘的按键?
- 请教 下 在 windows Vista/Win 7 下如何读取 BIOS 的内容?
- 那里可以找到 Delphi 5 Update Pack 1 的序列号?
- 各位大侠,有个线程中的问题,特别着急,46分送上!谢谢了
- 还是关于SQL语句的问题,很简单,请指教
- 哪里有DELPHI的串口控件?
r,g,b:intager
r:=integer(x/256/256)
g:=integer((x-r*256*256)/256)
b:=。返回[r,g,b]
这是原理说明,具体编程不难。
请问一下,由tcolor求r,g,b呢?
我试了一下,在delphi中可直接使用rgb(r,g,b)函数,但其分解函数是什么,却不知?
GetGValue
GetBValue
合并时我是这样的
Format('$00 %02x%02x%02x',[GetRValue(i),GetGValue(i),GetBValue(i)])
返回一个字符串,你或者可改写一下。
begin
result := byte(color shr 16);
end;
function GetGValue(color : integer) : byte;
begin
result := byte(color shr 8);
end;
function GetBValue(color : integer): byte;
begin
result := byte(color);
end;function rgb(r,g,b:byte):integer;
begin
result := (integer(r) shl 16) + (integer(g) shl 8) + integer(b);
end;