public void Initialize()
 {
     BitPlane = new BitPlane(Width * Height, Width);
 }
Beispiel #2
0
 public void Initialize()
 {
     BitPlane = new BitPlane(Width * Height, Width);
     //Make the data array the same length as the bitplane but read and write from file without the empty spaces
     data = new byte[Width * Height];
 }
        //put the byte data into this object
        public void SetData(byte[] data)
        {
            //assume the first two bytes of the label are not already skipped
            //and skip the size too
            int index = 4;
            this.Width = BitConverter.ToInt16(data, index);
            index += 2;
            this.Height = BitConverter.ToInt16(data, index);
            index += 2;
            int x = BitConverter.ToInt16(data, index);
            index += 2;
            int y = BitConverter.ToInt16(data, index);
            index += 2;
            this.Origin = new SxzPoint(x, y);

            this.ColorIndex = data[index];
            index++;

            BitPlane = new BitPlane(Width * Height, Width);

            //read bitmask bitplane
            byte[] bitplane = new byte[Frame.SizeOfBitPlaneInBytes(Width * Height)];
            Array.Copy(data, index, bitplane, 0, bitplane.Length);

            BitPlane.SetData(bitplane, Width * Height);
        }