GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ExcelPicture Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Represents a picture in the worksheet.

    • C#
    • VB.NET
    public sealed class ExcelPicture : ExcelDrawing
    Public NotInheritable Class ExcelPicture
        Inherits ExcelDrawing
    Inheritance:
    System.Object
    ExcelDrawing
    ExcelPicture

    Properties

    CameraRangeFormula

    Gets or sets the formula used by the camera tool to fill this picture.

    • C#
    • VB.NET
    public string CameraRangeFormula { get; set; }
    Public Property CameraRangeFormula As String
    Property Value
    System.String

    The formula used by the camera tool to fill this picture.

    Remarks

    The camera tool is active when this property is not null or empty. The formula will always be resolved to a cell range.
    This property is not supported in XLS file format.

    See Also
    CalculateCameraRange()

    Fill

    Gets or sets the fill formatting options.

    • C#
    • VB.NET
    public FillFormat Fill { get; set; }
    Public Property Fill As FillFormat
    Property Value
    FillFormat

    The fill formatting options.

    FlipHorizontal

    Gets or sets a value indicating whether to flip the drawing horizontally - reflect it across a vertical line that intersects the center of the drawing's bounding box.

    • C#
    • VB.NET
    public bool FlipHorizontal { get; set; }
    Public Property FlipHorizontal As Boolean
    Property Value
    System.Boolean

    true to flip the drawing horizontally; otherwise, false.

    Remarks

    This property is not supported in XLS file format.

    When set to a value different than the current FlipHorizontal, MS Excel automatically inverts the Rotation to 360° - Rotation (normalized to the interval [0°, 360°>). To follow the MS Excel's behavior, you should do the same.

    FlipVertical

    Gets or sets a value indicating whether to flip the drawing vertically - reflect it across a horizontal line that intersects the center of the drawing's bounding box.

    • C#
    • VB.NET
    public bool FlipVertical { get; set; }
    Public Property FlipVertical As Boolean
    Property Value
    System.Boolean

    true to flip the drawing horizontally; otherwise, false.

    Remarks

    This property is not supported in XLS file format.

    When set to a value different than the current FlipVertical, MS Excel automatically inverts the Rotation to 360° - Rotation (normalized to the interval [0°, 360°>). To follow the MS Excel's behavior, you should do the same.

    Outline

    Gets or sets the outline formatting options.

    • C#
    • VB.NET
    public LineFormat Outline { get; set; }
    Public Property Outline As LineFormat
    Property Value
    LineFormat

    The outline formatting options.

    PictureFormat

    Gets the picture format.

    • C#
    • VB.NET
    public ExcelPictureFormat PictureFormat { get; }
    Public ReadOnly Property PictureFormat As ExcelPictureFormat
    Property Value
    ExcelPictureFormat

    The picture format.

    PictureStream

    Gets the picture stream.

    • C#
    • VB.NET
    public MemoryStream PictureStream { get; }
    Public ReadOnly Property PictureStream As MemoryStream
    Property Value
    System.IO.MemoryStream

    The picture stream.

    Rotation

    Gets or sets the amount (in degrees) by which the drawing is rotated clockwise about the center of the drawing's bounding box.

    • C#
    • VB.NET
    public double Rotation { get; set; }
    Public Property Rotation As Double
    Property Value
    System.Double

    The amount (in degrees) by which the drawing is rotated clockwise about the center of the drawing's bounding box.

    Remarks

    This property is not supported in XLS file format.

    Transparency

    Gets or sets the transparency of the picture. Possible values range from 0 (full transparency) to 1 (no transparency). The default value is 1 (no transparency).

    • C#
    • VB.NET
    public double Transparency { get; set; }
    Public Property Transparency As Double
    Property Value
    System.Double

    The transparency of the picture.

    TransparentColor

    Gets or sets the transparent color in the image. By default, no transparent color is set.

    • C#
    • VB.NET
    public SpreadsheetColor? TransparentColor { get; set; }
    Public Property TransparentColor As SpreadsheetColor?
    Property Value
    System.Nullable<SpreadsheetColor>

    The transparent color in the image.

    Methods

    BringForward()

    Moves the picture one position forward in the drawings.

    • C#
    • VB.NET
    public void BringForward()
    Public Sub BringForward
    Remarks

    The index of the picture in the ExcelPictureCollection will not be updated if the drawing in front is a different type. But it will still update the position.

    BringToFront()

    Brings the picture to the front of the drawings.

    • C#
    • VB.NET
    public void BringToFront()
    Public Sub BringToFront

    CalculateCameraRange()

    Updates this ExcelPicture instance to reproduce the current content at the range specified in the CameraRangeFormula property.

    • C#
    • VB.NET
    public void CalculateCameraRange()
    Public Sub CalculateCameraRange

    Delete()

    Removes this ExcelPicture instance from the worksheet.

    • C#
    • VB.NET
    public void Delete()
    Public Sub Delete

    MoveZIndex(Int32)

    Moves the picture forward or backward in the drawings with the given relative index.

    • C#
    • VB.NET
    public void MoveZIndex(int relativeIndex)
    Public Sub MoveZIndex(relativeIndex As Integer)
    Parameters
    relativeIndex
    System.Int32

    The relative index for the picture to update. Negative to move backward and positive to move forward.

    SendBackward()

    Moves the picture one position backward in the drawings.

    • C#
    • VB.NET
    public void SendBackward()
    Public Sub SendBackward
    Remarks

    The index of the picture in the ExcelPictureCollection will not be updated if the item behind is a different type. But it will still update the position.

    SendToBack()

    Sends the picture to the back of the drawings.

    • C#
    • VB.NET
    public void SendToBack()
    Public Sub SendToBack

    ToImage()

    Converts this ExcelPicture instance to a new System.Drawing.Image instance.

    • C#
    • VB.NET
    public Image ToImage()
    Public Function ToImage As Image
    Returns
    System.Drawing.Image

    A new System.Drawing.Image instance created from this ExcelPicture instance.

    ToString()

    Returns a System.String that represents this ExcelPicture instance.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A System.String that represents this ExcelPicture instance.

    Overrides
    System.Object.ToString()
    Remarks

    This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).

    Inherited Properties

    Hyperlink

    Gets or sets the hyperlink on this drawing (picture, chart, etc.).

    (Inherited from ExcelDrawing)

    Metadata

    Gets the metadata (non-visual properties) of this ExcelDrawing instance.

    (Inherited from ExcelDrawing)

    Position

    Gets the position of this drawing (picture, chart, etc.) in the worksheet.

    (Inherited from ExcelDrawing)

    Worksheet

    Gets the parent worksheet.

    (Inherited from ExcelDrawing)

    ZIndex

    Gets the z-order position of the picture. -1 if the picture is not contained in proper collection.

    (Inherited from ExcelDrawing)

    Inherited Methods

    Format()

    Formats this drawing (picture, chart, etc.) to its default size so it can be exported to PDF, XPS, image or be printed.

    (Inherited from ExcelDrawing)

    Format(System.Double, System.Double, LengthUnit)

    Formats this drawing (picture, chart, etc.) to specified size so it can be exported to PDF, XPS, image or be printed.

    (Inherited from ExcelDrawing)

    See Also

    Pictures
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.