Пример #1
0
        public BitmapShape Add(Image image, Rectangle rect)
        {
            BitmapShape shape = this.Add(image, rect, ImageFormatToBlipType(image.RawFormat));

            shape.Child.Picture.LoadedFromExcel = false;
            return(shape);
        }
Пример #2
0
        public BitmapShape Add(Image image, MsoBlipType blipType, bool loadedFromExcelFile)
        {
            MsofbtBseRecord record = new MsofbtBseRecord
            {
                BlipType    = blipType,
                Version     = 2,
                RequiredWin = 6,
                Picture     = new MsoBitmapPictureRecord()
            };

            record.Picture.LoadedFromExcel = loadedFromExcelFile;
            record.Picture.Parent          = record;
            record.Picture.Image           = image;
            this.Worksheet.Parent.Pictures.Add(record);
            BitmapShape shape = new BitmapShape(this, image)
            {
                Child  = record,
                Right  = image.Width,
                Bottom = image.Height,
                Id     = this.Worksheet.Parent.Pictures.Count
            };

            this.items.Add(shape);
            return(shape);
        }
Пример #3
0
        public BitmapShape Add(Image image, Rectangle rect, MsoBlipType blipType)
        {
            BitmapShape shape = this.Add(image, blipType, true);

            shape.Left   = rect.Left;
            shape.Top    = rect.Top;
            shape.Right  = rect.Right;
            shape.Bottom = rect.Bottom;
            return(shape);
        }
Пример #4
0
 internal ExcelShapeCollection(ExcelWorksheet worksheet, ExcelShapeCollection sourceShapes)
     : this(worksheet)
 {
     for (int i = 0; i < sourceShapes.Count; i++)
     {
         BitmapShape shape = (BitmapShape)sourceShapes[i];
         Rectangle   rect  = new Rectangle(shape.Left, shape.Top, shape.Right - shape.Left, shape.Bottom - shape.Top);
         this.Add(shape.Image, rect);
     }
 }