Aries.IconMethods.IcDvImg.setDeviceImage C# (CSharp) Method

setDeviceImage() private method

private setDeviceImage ( Size size, ColorDepth colorDepth ) : void
size Size
colorDepth ColorDepth
return void
        private void setDeviceImage(Size size, ColorDepth colorDepth)
        {
            this.size = size;
            this.colorDepth = colorDepth;
            BITMAPINFOHEADER bmInfoHeader = new BITMAPINFOHEADER(size, colorDepth);
            this.data = new byte[this.MaskImageIndex(bmInfoHeader) + this.MaskImageSize(bmInfoHeader)];
            MemoryStream output = new MemoryStream(this.data, 0, this.data.Length, true);
            BinaryWriter bw = new BinaryWriter(output);
            bmInfoHeader.Write(bw);
            switch (this.colorDepth)
            {
                case ColorDepth.Depth4Bit:
                    this.write16ColorPalette(bw);
                    break;

                case ColorDepth.Depth8Bit:
                    this.write256ColorPalette(bw);
                    goto Label_0077;
            }
            Label_0077:
            bw.Close();
        }