懂VB和delphi的大虾请进!(100分)

  • 主题发起人 迷惘的人
  • 开始时间

迷惘的人

Unregistered / Unconfirmed
GUEST, unregistred user!
怎样将下列VB的语句翻译成delphi的语句?
Dim Colors(5) As Long
Colors(0) = RGB(188, 188, 65)
Colors(1) = RGB(213, 204, 187)
Colors(2) = RGB(255, 255, 65)
Colors(3) = RGB(128, 180, 128)
Colors(4) = RGB(144, 127, 97)
A = colors()
 
var colors:array[0..4] of integer;
A:array [0..4] of integer;
begin
Colors[0] := RGB(188, 188, 65);
Colors[1]:= RGB(213, 204, 187);
Colors[2] := RGB(255, 255, 65);
Colors[3] := RGB(128, 180, 128);
Colors[4] := RGB(144, 127, 97);
A:=Colors;
end;
 
var colors:array[0..4] of TColor;
begin
color[0]=188 + 188 shl 8 + 65 shl 16;
color[1]=213 + 204 shl 8 + 187 shl 16;
...
...
end;
 
在delphi也有rgb这个函数你可以试试
 
function RGB(r, g, b: Byte): COLORREF;
begin
Result := (r or (g shl 8) or (b shl 16));
end;
 
我来的更迟了
 
我来的更迟,呵呵
 
早知道我就不用来了....
 
我来的更迟[8D][8D]
 
就是就是,这个问题早该结了。
 
还没有结,嘿,我来得早了
 
to takashiki: 稍做修改 integer改为longint;
 
晚了~ 连盘底都看不见了
 
这问题都100分,气死我了。
 
顶部