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

    Show / Hide Table of Contents

    ExcelPictureCollection Class

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

    Represents a collection of ExcelPictures in the worksheet or group.

    • C#
    • VB.NET
    public sealed class ExcelPictureCollection : ExcelDrawingCollection<ExcelPicture>, IList<ExcelPicture>, ICollection<ExcelPicture>, IEnumerable<ExcelPicture>, IEnumerable
    Public NotInheritable Class ExcelPictureCollection
        Inherits ExcelDrawingCollection(Of ExcelPicture)
        Implements IList(Of ExcelPicture), ICollection(Of ExcelPicture), IEnumerable(Of ExcelPicture), IEnumerable
    Inheritance:
    System.Object
    ExcelDrawingCollection<ExcelPicture>
    ExcelPictureCollection
    Implements
    System.Collections.Generic.IList<ExcelPicture>
    System.Collections.Generic.ICollection<ExcelPicture>
    System.Collections.Generic.IEnumerable<ExcelPicture>
    System.Collections.IEnumerable

    Methods

    Add(MemoryStream, ExcelPictureFormat, AnchorCell, AnchorCell)

    Adds a new picture to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(MemoryStream pictureStream, ExcelPictureFormat pictureFormat, AnchorCell positionFrom, AnchorCell positionTo)
    Public Function Add(pictureStream As MemoryStream, pictureFormat As ExcelPictureFormat, positionFrom As AnchorCell, positionTo As AnchorCell) As ExcelPicture
    Parameters
    pictureStream
    System.IO.MemoryStream

    The picture's stream.

    pictureFormat
    ExcelPictureFormat

    The picture's format.

    positionFrom
    AnchorCell

    The picture's position (top-left corner).

    positionTo
    AnchorCell

    The picture's end position (bottom-right corner).

    Returns
    ExcelPicture

    A new picture added to the collection which moves and sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be MoveAndSize.

    Add(MemoryStream, ExcelPictureFormat, AnchorCell, Double, Double, LengthUnit)

    Adds a new picture to the collection which moves but doesn't size with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(MemoryStream pictureStream, ExcelPictureFormat pictureFormat, AnchorCell positionFrom, double width, double height, LengthUnit unit)
    Public Function Add(pictureStream As MemoryStream, pictureFormat As ExcelPictureFormat, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pictureStream
    System.IO.MemoryStream

    The picture's stream.

    pictureFormat
    ExcelPictureFormat

    The picture's format.

    positionFrom
    AnchorCell

    The picture's position.

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    Add(MemoryStream, ExcelPictureFormat, Double, Double, Double, Double, LengthUnit)

    Adds a new picture to the collection which doesn't move nor sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(MemoryStream pictureStream, ExcelPictureFormat pictureFormat, double left, double top, double width, double height, LengthUnit unit)
    Public Function Add(pictureStream As MemoryStream, pictureFormat As ExcelPictureFormat, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pictureStream
    System.IO.MemoryStream

    The picture's stream.

    pictureFormat
    ExcelPictureFormat

    The picture's format.

    left
    System.Double

    The distance of the left edge of the picture from the left edge of the worksheet or group.

    top
    System.Double

    The distance of the top edge of the picture from the top edge of the worksheet or group.

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which doesn't move nor sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be FreeFloating.

    Add(MemoryStream, ExcelPictureFormat, String, Double, Double, LengthUnit)

    Adds a new picture to the collection which moves but doesn't size with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(MemoryStream pictureStream, ExcelPictureFormat pictureFormat, string positionFromCell, double width, double height, LengthUnit unit)
    Public Function Add(pictureStream As MemoryStream, pictureFormat As ExcelPictureFormat, positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pictureStream
    System.IO.MemoryStream

    The picture's stream.

    pictureFormat
    ExcelPictureFormat

    The picture's format.

    positionFromCell
    System.String

    The picture's position (for example, "A1").

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    Add(MemoryStream, ExcelPictureFormat, String, String)

    Adds a new picture to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(MemoryStream pictureStream, ExcelPictureFormat pictureFormat, string positionFromCell, string positionToCell)
    Public Function Add(pictureStream As MemoryStream, pictureFormat As ExcelPictureFormat, positionFromCell As String, positionToCell As String) As ExcelPicture
    Parameters
    pictureStream
    System.IO.MemoryStream

    The picture's stream.

    pictureFormat
    ExcelPictureFormat

    The picture's format.

    positionFromCell
    System.String

    The picture's position (top-left corner) (for example, "A1").

    positionToCell
    System.String

    The picture's end position (bottom-right corner) (for example, "B2").

    Returns
    ExcelPicture

    A new picture added to the collection which moves and sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be MoveAndSize.

    Add(String, AnchorCell)

    Adds a new picture to the collection which moves but doesn't size with cells. Picture size will be determined by decoding the image data.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, AnchorCell positionFrom)
    Public Function Add(pathOrCameraFormula As String, positionFrom As AnchorCell) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFrom
    AnchorCell

    The picture's position.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    This method decodes image data to determine picture's size.

    Add(String, AnchorCell, AnchorCell)

    Adds a new picture to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, AnchorCell positionFrom, AnchorCell positionTo)
    Public Function Add(pathOrCameraFormula As String, positionFrom As AnchorCell, positionTo As AnchorCell) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFrom
    AnchorCell

    The picture's position (top-left corner).

    positionTo
    AnchorCell

    The picture's end position (bottom-right corner).

    Returns
    ExcelPicture

    A new picture added to the collection which moves and sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be MoveAndSize.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, AnchorCell, AnchorCell, ExcelObjectSourceType)

    Adds a new picture to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, AnchorCell positionFrom, AnchorCell positionTo, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, positionFrom As AnchorCell, positionTo As AnchorCell, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFrom
    AnchorCell

    The picture's position (top-left corner).

    positionTo
    AnchorCell

    The picture's end position (bottom-right corner).

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which moves and sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be MoveAndSize.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, AnchorCell, ExcelObjectSourceType)

    Adds a new picture to the collection which moves but doesn't size with cells. Picture size will be determined by decoding the image data.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, AnchorCell positionFrom, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, positionFrom As AnchorCell, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFrom
    AnchorCell

    The picture's position.

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    This method decodes image data to determine picture's size.

    Add(String, AnchorCell, Double, Double, LengthUnit)

    Adds a new picture to the collection which moves but doesn't size with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, AnchorCell positionFrom, double width, double height, LengthUnit unit)
    Public Function Add(pathOrCameraFormula As String, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFrom
    AnchorCell

    The picture's position.

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, AnchorCell, Double, Double, LengthUnit, ExcelObjectSourceType)

    Adds a new picture to the collection which moves but doesn't size with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, AnchorCell positionFrom, double width, double height, LengthUnit unit, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, positionFrom As AnchorCell, width As Double, height As Double, unit As LengthUnit, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFrom
    AnchorCell

    The picture's position.

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, Double, Double, LengthUnit)

    Adds a new picture to the collection which doesn't move nor sizes with cells. Picture size will be determined by decoding the image data.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, double left, double top, LengthUnit unit)
    Public Function Add(pathOrCameraFormula As String, left As Double, top As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    left
    System.Double

    The distance of the left edge of the picture from the left edge of the worksheet or group.

    top
    System.Double

    The distance of the top edge of the picture from the top edge of the worksheet or group.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which doesn't move nor sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be FreeFloating.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    This method decodes image data to determine picture's size.

    Add(String, Double, Double, LengthUnit, ExcelObjectSourceType)

    Adds a new picture to the collection which doesn't move nor sizes with cells. Picture size will be determined by decoding the image data.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, double left, double top, LengthUnit unit, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, left As Double, top As Double, unit As LengthUnit, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    left
    System.Double

    The distance of the left edge of the picture from the left edge of the worksheet or group.

    top
    System.Double

    The distance of the top edge of the picture from the top edge of the worksheet or group.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which doesn't move nor sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be FreeFloating.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    This method decodes image data to determine picture's size.

    Add(String, Double, Double, Double, Double, LengthUnit)

    Adds a new picture to the collection which doesn't move nor sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, double left, double top, double width, double height, LengthUnit unit)
    Public Function Add(pathOrCameraFormula As String, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    left
    System.Double

    The distance of the left edge of the picture from the left edge of the worksheet or group.

    top
    System.Double

    The distance of the top edge of the picture from the top edge of the worksheet or group.

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which doesn't move nor sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be FreeFloating.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, Double, Double, Double, Double, LengthUnit, ExcelObjectSourceType)

    Adds a new picture to the collection which doesn't move nor sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, double left, double top, double width, double height, LengthUnit unit, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, left As Double, top As Double, width As Double, height As Double, unit As LengthUnit, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    left
    System.Double

    The distance of the left edge of the picture from the left edge of the worksheet or group.

    top
    System.Double

    The distance of the top edge of the picture from the top edge of the worksheet or group.

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which doesn't move nor sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be FreeFloating.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, String)

    Adds a new picture to the collection which moves but doesn't size with cells. Picture size will be determined by using decoding the image data.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, string positionFromCell)
    Public Function Add(pathOrCameraFormula As String, positionFromCell As String) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFromCell
    System.String

    The picture's position (for example, "A1").

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    This method decodes image data to determine picture's size.

    Add(String, String, ExcelObjectSourceType)

    Adds a new picture to the collection which moves but doesn't size with cells. Picture size will be determined by decoding the image data.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, string positionFromCell, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, positionFromCell As String, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFromCell
    System.String

    The picture's position (for example, "A1").

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    This method decodes image data to determine picture's size.

    Add(String, String, Double, Double, LengthUnit)

    Adds a new picture to the collection which moves but doesn't size with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, string positionFromCell, double width, double height, LengthUnit unit)
    Public Function Add(pathOrCameraFormula As String, positionFromCell As String, width As Double, height As Double, unit As LengthUnit) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFromCell
    System.String

    The picture's position (for example, "A1").

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, String, Double, Double, LengthUnit, ExcelObjectSourceType)

    Adds a new picture to the collection which moves but doesn't size with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, string positionFromCell, double width, double height, LengthUnit unit, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, positionFromCell As String, width As Double, height As Double, unit As LengthUnit, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFromCell
    System.String

    The picture's position (for example, "A1").

    width
    System.Double

    The picture's width.

    height
    System.Double

    The picture's height.

    unit
    LengthUnit

    The length unit in which all length parameters are specified.

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which moves but doesn't size with cells.

    Remarks

    Position.Mode of a newly added picture will be Move.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, String, String)

    Adds a new picture to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, string positionFromCell, string positionToCell)
    Public Function Add(pathOrCameraFormula As String, positionFromCell As String, positionToCell As String) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFromCell
    System.String

    The picture's position (top-left corner) (for example, "A1").

    positionToCell
    System.String

    The picture's end position (bottom-right corner) (for example, "B2").

    Returns
    ExcelPicture

    A new picture added to the collection which moves and sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be MoveAndSize.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Add(String, String, String, ExcelObjectSourceType)

    Adds a new picture to the collection which moves and sizes with cells.

    • C#
    • VB.NET
    public ExcelPicture Add(string pathOrCameraFormula, string positionFromCell, string positionToCell, ExcelObjectSourceType sourceType)
    Public Function Add(pathOrCameraFormula As String, positionFromCell As String, positionToCell As String, sourceType As ExcelObjectSourceType) As ExcelPicture
    Parameters
    pathOrCameraFormula
    System.String

    The picture's path or formula to be used in the camera tool.

    positionFromCell
    System.String

    The picture's position (top-left corner) (for example, "A1").

    positionToCell
    System.String

    The picture's end position (bottom-right corner) (for example, "B2").

    sourceType
    ExcelObjectSourceType

    the picture's embedding or linking setting.

    Returns
    ExcelPicture

    A new picture added to the collection which moves and sizes with cells.

    Remarks

    Position.Mode of a newly added picture will be MoveAndSize.

    The pathOrCameraFormula parameter must contain the supported extension (for example, ".png") when used as the path, or must start with '=' when used as the camera range formula, otherwise an exception is thrown.

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    See Also

    Pictures
    Pictures
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.