Class PicFormatOption

PicFormatOption class

Represents picture format option

public class PicFormatOption

Constructors

NameDescription
PicFormatOption()The default constructor.

Properties

NameDescription
Bottom { get; set; }Gets or sets the bottom offset for stretching picture.
Left { get; set; }Gets or sets the left offset for stretching picture.
Right { get; set; }Gets or sets the right offset for stretching picture.
Scale { get; set; }Gets or sets how many the picture stack and scale with.
Top { get; set; }Gets or sets the top offset for stretching picture.
Type { get; set; }Gets or sets the picture fill type.

Examples

namespace AsposeCellsExamples
{
    using Aspose.Cells;
    using Aspose.Cells.Drawing;
    using System.IO;

    public class DrawingClassPicFormatOptionDemo
    {
        public static void Run()
        {
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add a shape and set picture fill
            Shape shape = worksheet.Shapes.AddRectangle(5, 5, 0, 0, 200, 200);
            // FillType property removed from MsoFillFormat access
            shape.FillFormat.ImageData = File.ReadAllBytes("aspose-logo.png");

            // Configure picture format options
            PicFormatOption picFormat = new PicFormatOption
            {
                Type = FillPictureType.Stretch,
                Left = 0.15,
                Right = 0.15,
                Top = 0.15,
                Bottom = 0.15,
                Scale = 0.8
            };

            // Add second shape with tiled image
            Shape tiledShape = worksheet.Shapes.AddRectangle(5, 210, 0, 0, 200, 200);
            // FillType property removed from MsoFillFormat access
            tiledShape.FillFormat.ImageData = File.ReadAllBytes("aspose-logo.png");
            
            PicFormatOption tileFormat = new PicFormatOption
            {
                Type = FillPictureType.Stack,
                Scale = 1.5
            };

            workbook.Save("PicFormatOptionDemo.xlsx");
        }
    }
}

See Also