【发布时间】:2015-11-05 12:08:18
【问题描述】:
我有一个 c# 项目,我正在尝试将其转换为 Delphi。
我有一个函数addcoord
public static byte[] addCoord(Coordinate C, int ID)
{
//Create an empty array of length 10
byte[] ret = new byte[10];
ret[0] = Convert.ToByte(newClass.Add);
ret[1] = Convert.ToByte(ID);
ret[2] = BitConverter.GetBytes(C.X)[0];
//High-Byte of uInt16 X
ret[3] = BitConverter.GetBytes(C.X)[1];
//Low-Byte of uInt16 Y
ret[4] = BitConverter.GetBytes(C.Y)[0];
//High-Byte of uInt16 Y
ret[5] = BitConverter.GetBytes(C.Y)[1];
ret[6] = C.Red;
ret[7] = C.Green;
ret[8] = C.Blue;
ret[9] = C.Master;
return ret;
}
在 Delphi 中是否有与此等价的功能?
【问题讨论】: