FromBytes() public method

Constructs this Point from a byte array.
public FromBytes ( byte data ) : void
data byte The byte array to construct the from.
return void
示例#1
0
        public void FromBytes(byte[] data)
        {
            var pt = new Point();

            pt.FromBytes(data);
            this = new Size(pt);
        }
示例#2
0
        public void FromBytes_0x7F_0xFF_0x00_0xBF_0x00_0xBF_0x7F_0xFF()
        {
            var expectedX = 0x7FFF00BF;
            var expectedY = 0x00BF7FFF;

            Point point = new Point();
            point.FromBytes(new byte[] { 0x7F, 0xFF, 0x00, 0xBF, 0x00, 0xBF, 0x7F, 0xFF });

            Assert.AreEqual(expectedX, point.X);
            Assert.AreEqual(expectedY, point.Y);
        }