Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / Picture Class
Members Example


In This Topic
    Picture Class
    In This Topic
    Represents a Picture element in the PictureCollection
    Syntax
    'Declaration
     
    
    Public Class Picture 
       Inherits PositionedElement
    'Usage
     
    
    Dim instance As Picture
    public class Picture : PositionedElement 
    Remarks

    Pictures can be associated with one of three Anchor types : AbsoluteAnchorOneCellAnchor or TwoCellAnchor.

    The type of Anchor used by a Picture can be retrieved with the AnchorType property. 

    Example
    using( var workbook = Workbook.Create( "test.xlsx") )
      {
        // Get the first worksheet. A workbook contains at least 1 worksheet.
        var worksheet = workbook.Worksheets[ 0 ];
    
        var stream = new FileStream( PictureSampleResourcesDirectory + @"balloon.jpg", FileMode.Open, FileAccess.Read );
        // Add the stream picture in cell A4 and extend it to cell E12.
        var filenamePicture = worksheet.Pictures.Add( stream, "A4", "E12" );
    
        // Add the filename picture with its top left corner in 15th row and 1st column.
        var streamPicture = worksheet.Pictures.Add( PictureSampleResourcesDirectory + @"balloon.jpg", 14, 0 );
    
        workbook.Save();
      }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.WorkbookElement
          Xceed.Workbooks.NET.WorksheetElement
             Xceed.Workbooks.NET.PositionedElement
                Xceed.Workbooks.NET.Picture

    Public Properties
     NameDescription
    Public PropertyGets/sets the absolute position of the Picture in the Worksheet. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets/sets the Anchor's position in the Worksheet. This position is determined by a StartingElement and an EndingElement, which sets a CellRange. For it to work, the CellRange must be located  within the same Worksheet as the Picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets the Anchor's type. An Anchor can be either an AbsoluteAnchor, a OneCellAnchor or a TwoCellAnchor. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyOffsets the bottom right corner of a TwoCellAnchor Picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyThis property contains the description of the picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyClass property that contains the information of the ClientData, which is how the data should behave when the worksheet is protected. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets the PictureFormat.  
    Public PropertyGets/sets the height of an AbsoluteAnchor or OneCellAnchor Picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets/sets the unit used for measuring the Width and Height of the Picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets or sets the name of the Picture in the Worksheet. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets the PictureLocks, which contains the manipulations allowed on the Picture.  
    Public PropertyOffsets the top right corner of a TwoCellAnchor Picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets or sets the behavior of the TwoCellAnchor Picture when moving or deleting Rows or Columns. The defaut setting is MoveAndResize. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Public PropertyGets/sets the width of an AbsoluteAnchor or OneCellAnchor Picture. (Inherited from Xceed.Workbooks.NET.PositionedElement)
    Top
    Public Methods
     NameDescription
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Public MethodOverloaded.   
    Public Method  
    Public Method  
    Public Method  
    Public Method  
    Top
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also