Class PictureBulletValue

PictureBulletValue class

Represents the value of the image bullet.

public class PictureBulletValue : BulletValue

Constructors

NameDescription
PictureBulletValue()The default constructor.

Properties

NameDescription
ImageData { get; set; }Gets and sets image data of the bullet.
override Type { get; }Gets the type of the bullet’s value.

Examples

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

    public class TextsClassPictureBulletValueDemo
    {
        public static void Run()
        {
            // Create a new workbook for demonstration
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];
            
            try
            {
                // Create an instance of the PictureBulletValue class
                PictureBulletValue bulletValue = new PictureBulletValue();
                
                // Load sample image data (replace with actual image path)
                string imagePath = "sample.png";
                if (File.Exists(imagePath))
                {
                    bulletValue.ImageData = File.ReadAllBytes(imagePath);
                    
                    // Display basic information
                    Console.WriteLine($"PictureBulletValue created with Type: {bulletValue.Type}");
                    Console.WriteLine($"Image data length: {bulletValue.ImageData?.Length ?? 0} bytes");
                }
                else
                {
                    Console.WriteLine("Sample image not found, using empty bullet value");
                }
                
                // Save the workbook
                workbook.Save("PictureBulletValueDemo.xlsx");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error working with PictureBulletValue: {ex.Message}");
            }
        }
    }
}

See Also