Exemplo n.º 1
0
        /// <summary>
        /// 从文件数据流中读取图形控制扩展(Graphic Control Extension)
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        internal LogicalScreenDescriptor GetLCD(Stream stream)
        {
            LogicalScreenDescriptor lcd = new LogicalScreenDescriptor();

            lcd.Width  = ReadShort();
            lcd.Height = ReadShort();
            lcd.Packed = (byte)Read();
            lcd.GlobalColorTableFlag = ((lcd.Packed & 0x80) >> 7) == 1;
            lcd.ColorResoluTion      = (byte)((lcd.Packed & 0x60) >> 5);
            lcd.SortFlag             = (byte)(lcd.Packed & 0x10) >> 4;
            lcd.GlobalColorTableSize = 2 << (lcd.Packed & 0x07);
            lcd.BgColorIndex         = (byte)Read();
            lcd.PixcelAspect         = (byte)Read();
            return(lcd);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 写逻辑屏幕标识符
 /// </summary>
 /// <param name="lsd"></param>
 internal void WriteLSD(LogicalScreenDescriptor lsd)
 {
     WriteBytes(lsd.GetBuffer());
 }