1.RGB转换为Tcolor

function RGBToColor(R,G,B: byte): Tcolor;
begin
  Result := B Shl 16 or G  shl 8 or R;
end;

 

2.Tcolor转换为RGB

 

proceudre Tform1.Button1Clink(Sender: Tobject);
var
  Color: TColor;
  R, G, B: integer;
begin
  Color := ClBlack;
  R := Color and $FF;
  G := (Color and $FF00) shr 8;
  B := (Color and $FF0000) shr 16;
end;

相关文章:

  • 2022-12-23
  • 2022-02-26
  • 2021-06-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
相关资源
相似解决方案