Esempio n. 1
0
        private void ReadCreateBrushIndirect(BinaryReader wmfReader)
        {
            var wmfBrush = new LogBrush();

            wmfBrush.Style = (BrushStyle)EndianFlip(wmfReader.ReadUInt16());
            var red = wmfReader.ReadByte();
            var green = wmfReader.ReadByte();
            var blue = wmfReader.ReadByte();
            wmfBrush.Colour = Color.FromArgb(255, red, green, blue);
            wmfReader.ReadByte(); // Reserved
            wmfBrush.Hatch = (HatchStyle)EndianFlip(wmfReader.ReadUInt16());

            _currentDC.CreateBrushIndirect(wmfBrush);
        }
Esempio n. 2
0
        private void ReadCreateDibPatternBrush(BinaryReader wmfReader, uint recordSize)
        {
            var wmfBrush = new LogBrush();
            wmfBrush.Style = (BrushStyle)EndianFlip(wmfReader.ReadUInt16());
            var colorUsage = (ColorUsage)EndianFlip(wmfReader.ReadUInt16());
            int width = 0;
            int height = 0;

            //if (wmfBrush.Style == BrushStyle.BS_PATTERN)
            //{
            //    // TODO: Bitmap16
            //    wmfBrush.Image = ReadBitmap16(wmfReader, (recordSize * 2) - 10);
            //    currentDC.CreateBrushIndirect(wmfBrush);
            //}
            //else
            //{
            // If style is not BS_PATTERN then BS_DIBPATTERNRT must be assumed
            wmfBrush.Image = ReadDeviceIndependantBitmap(wmfReader, (recordSize * 2) - 10, out width, out height);

            _currentDC.CreateBrushIndirect(wmfBrush);
            //}
        }
Esempio n. 3
0
 public void CreateBrushIndirect(LogBrush brush)
 {
     _objectTable.AddObject(brush);
 }