[]
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLImage img, int x, int y)
Public Sub New(img As XLImage, x As Integer, y As Integer)
| Type | Name | Description |
|---|---|---|
| XLImage | img | The image contained in the new XLPictureShape. |
| int | x | The horizontal position of the new shape with respect to the cell, in twips. |
| int | y | The vertical position of the new shape with respect to the cell, in twips. |
The code below adds an image to a cell. The image is rendered in its original size, and is indented from the top left corner of the cell by 30 twips:
// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell cell = sheet[row, col];
// build XLPictureShape
XLPictureShape pic = new XLPictureShape(image, 30, 30);
// assign XLPictureShape to cell
cell.Value = pic;
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLImage img, int x, int y, int width, int height)
Public Sub New(img As XLImage, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| XLImage | img | The image contained in the new XLPictureShape. |
| int | x | The horizontal position of the image with respect to the cell, in twips. |
| int | y | The vertical position of the image with respect to the cell, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
The code below adds an image to a cell. The image is drawn within a rectangle centered on a cell with a 60 twip edge around it:
// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell cell = sheet[row, col];
// calculate cell size to align picture
Rectangle rc = new Rectangle(0, 0
sheet.Columns[col].Width,
sheet.Rows[row].Height);
// add 60 twip edge
rc.Inflate(-60, -60);
// build XLPictureShape
XLPictureShape pic = new XLPictureShape(image,
rc.X, rc.Y, rc.Width, rc.Height);
// assign XLPictureShape to cell
cell.Value = pic;
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLImage img, RectangleF rc)
Public Sub New(img As XLImage, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| XLImage | img | The image contained in the new XLPictureShape. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
The code below adds an image to a cell. The image is drawn within a rectangle centered on a cell with a 60 twip edge around it:
// get sheet and cell
XLSheet sheet = c1ExcelBook1.Sheets[0];
XLCell cell = sheet[row, col];
// calculate cell size to align picture
Rectangle rc = new Rectangle(0, 0
sheet.Columns[col].Width,
sheet.Rows[row].Height);
// add 60 twip edge
rc.Inflate(-60, -60);
// build XLPictureShape
XLPictureShape pic = new XLPictureShape(image, rc);
// assign XLPictureShape to cell
cell.Value = pic;
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLImage img)
Public Sub New(img As XLImage)
| Type | Name | Description |
|---|---|---|
| XLImage | img | The image contained in the new XLPictureShape. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLImage img, SizeF cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Public Sub New(img As XLImage, cellSize As SizeF, align As XLAlignHorz, valign As XLAlignVert, scale As ImageScaling)
| Type | Name | Description |
|---|---|---|
| XLImage | img | The GrapeCity.Documents.Drawing.Image contained in the new XLPictureShape. |
| SizeF | cellSize | The size of the cell that will contain the image, in pixels (used for aligning the image). |
| XLAlignHorz | align | A XLAlignHorz value that specifies the position of the image in the cell. |
| XLAlignVert | valign | A XLAlignVert value that specifies the position of the image in the cell. |
| ImageScaling | scale | An ImageScaling value that specifies the image scaling within the cell. |
This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes and on the given alignment and scaling parameters.
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, XLImage img, int x, int y, int width, int height)
<CLSCompliant(False)>
Public Sub New(sheet As XLSheet, img As XLImage, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| XLImage | img | The image contained in the new XLPictureShape. |
| int | x | The horizontal position of the image with respect to the sheet, in twips. |
| int | y | The vertical position of the image with respect to the sheet, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, XLImage img, RectangleF rc)
<CLSCompliant(False)>
Public Sub New(sheet As XLSheet, img As XLImage, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| XLImage | img | The image contained in the new XLPictureShape. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(IImage image, int x, int y)
<CLSCompliant(False)>
Public Sub New(image As IImage, x As Integer, y As Integer)
| Type | Name | Description |
|---|---|---|
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
| int | x | The horizontal position of the new shape with respect to the cell, in twips. |
| int | y | The vertical position of the new shape with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(IImage image, int x, int y, int width, int height)
<CLSCompliant(False)>
Public Sub New(image As IImage, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
| int | x | The horizontal position of the image with respect to the cell, in twips. |
| int | y | The vertical position of the image with respect to the cell, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(IImage image, RectangleF rc)
<CLSCompliant(False)>
Public Sub New(image As IImage, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(IImage image)
<CLSCompliant(False)>
Public Sub New(image As IImage)
| Type | Name | Description |
|---|---|---|
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(IImage image, SizeF cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
<CLSCompliant(False)>
Public Sub New(image As IImage, cellSize As SizeF, align As XLAlignHorz, valign As XLAlignVert, scale As ImageScaling)
| Type | Name | Description |
|---|---|---|
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
| SizeF | cellSize | The size of the cell that will contain the image, in pixels (used for aligning the image). |
| XLAlignHorz | align | A XLAlignHorz value that specifies the position of the image in the cell. |
| XLAlignVert | valign | A XLAlignVert value that specifies the position of the image in the cell. |
| ImageScaling | scale | An ImageScaling value that specifies the image scaling within the cell. |
This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes and on the given alignment and scaling parameters.
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, IImage image, int x, int y, int width, int height)
<CLSCompliant(False)>
Public Sub New(sheet As XLSheet, image As IImage, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
| int | x | The horizontal position of the image with respect to the sheet, in twips. |
| int | y | The vertical position of the image with respect to the sheet, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, IImage image, RectangleF rc)
<CLSCompliant(False)>
Public Sub New(sheet As XLSheet, image As IImage, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| IImage | image | The GrapeCity.Documents.Drawing.IImage source. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(byte[] data, int x, int y)
Public Sub New(data As Byte(), x As Integer, y As Integer)
| Type | Name | Description |
|---|---|---|
| byte[] | data | The binary data as image source. |
| int | x | The horizontal position of the new shape with respect to the cell, in twips. |
| int | y | The vertical position of the new shape with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(byte[] data, int x, int y, int width, int height)
Public Sub New(data As Byte(), x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| byte[] | data | The binary data as image source. |
| int | x | The horizontal position of the image with respect to the cell, in twips. |
| int | y | The vertical position of the image with respect to the cell, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(byte[] data, RectangleF rc)
Public Sub New(data As Byte(), rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| byte[] | data | The binary data as image source. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(byte[] data)
Public Sub New(data As Byte())
| Type | Name | Description |
|---|---|---|
| byte[] | data | The binary data as image source. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(byte[] data, Size cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Public Sub New(data As Byte(), cellSize As Size, align As XLAlignHorz, valign As XLAlignVert, scale As ImageScaling)
| Type | Name | Description |
|---|---|---|
| byte[] | data | The binary data as image source. |
| Size | cellSize | The size of the cell that will contain the image, in pixels (used for aligning the image). |
| XLAlignHorz | align | A XLAlignHorz value that specifies the position of the image in the cell. |
| XLAlignVert | valign | A XLAlignVert value that specifies the position of the image in the cell. |
| ImageScaling | scale | An ImageScaling value that specifies the image scaling within the cell. |
This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes and on the given alignment and scaling parameters.
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLSheet sheet, byte[] data, int x, int y, int width, int height)
Public Sub New(sheet As XLSheet, data As Byte(), x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| byte[] | data | The binary data as image source. |
| int | x | The horizontal position of the image with respect to the sheet, in twips. |
| int | y | The vertical position of the image with respect to the sheet, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLSheet sheet, byte[] data, RectangleF rc)
Public Sub New(sheet As XLSheet, data As Byte(), rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| byte[] | data | The binary data as image source. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(Stream stream, int x, int y)
Public Sub New(stream As Stream, x As Integer, y As Integer)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream with image source. |
| int | x | The horizontal position of the new shape with respect to the cell, in twips. |
| int | y | The vertical position of the new shape with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(Stream stream, int x, int y, int width, int height)
Public Sub New(stream As Stream, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream with image source. |
| int | x | The horizontal position of the image with respect to the cell, in twips. |
| int | y | The vertical position of the image with respect to the cell, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(Stream stream, RectangleF rc)
Public Sub New(stream As Stream, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream with image source. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(Stream stream)
Public Sub New(stream As Stream)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream with image source. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(Stream stream, SizeF cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Public Sub New(stream As Stream, cellSize As SizeF, align As XLAlignHorz, valign As XLAlignVert, scale As ImageScaling)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream with image source. |
| SizeF | cellSize | The size of the cell that will contain the image, in pixels (used for aligning the image). |
| XLAlignHorz | align | A XLAlignHorz value that specifies the position of the image in the cell. |
| XLAlignVert | valign | A XLAlignVert value that specifies the position of the image in the cell. |
| ImageScaling | scale | An ImageScaling value that specifies the image scaling within the cell. |
This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes and on the given alignment and scaling parameters.
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLSheet sheet, Stream stream, int x, int y, int width, int height)
Public Sub New(sheet As XLSheet, stream As Stream, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| Stream | stream | The stream with image source. |
| int | x | The horizontal position of the image with respect to the sheet, in twips. |
| int | y | The vertical position of the image with respect to the sheet, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLSheet sheet, Stream stream, RectangleF rc)
Public Sub New(sheet As XLSheet, stream As Stream, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| Stream | stream | The stream with image source. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(string source, int x, int y)
Public Sub New(source As String, x As Integer, y As Integer)
| Type | Name | Description |
|---|---|---|
| string | source | Text source as file path or base64 string data. |
| int | x | The horizontal position of the new shape with respect to the cell, in twips. |
| int | y | The vertical position of the new shape with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(string source, int x, int y, int width, int height)
Public Sub New(source As String, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| string | source | Text source as file path or base64 string data. |
| int | x | The horizontal position of the image with respect to the cell, in twips. |
| int | y | The vertical position of the image with respect to the cell, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(string source, RectangleF rc)
Public Sub New(source As String, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| string | source | Text source as file path or base64 string data. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(string source)
Public Sub New(source As String)
| Type | Name | Description |
|---|---|---|
| string | source | Text source as file path or base64 string data. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(string source, SizeF cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Public Sub New(source As String, cellSize As SizeF, align As XLAlignHorz, valign As XLAlignVert, scale As ImageScaling)
| Type | Name | Description |
|---|---|---|
| string | source | Text source as file path or base64 string data. |
| SizeF | cellSize | The size of the cell that will contain the image, in pixels (used for aligning the image). |
| XLAlignHorz | align | A XLAlignHorz value that specifies the position of the image in the cell. |
| XLAlignVert | valign | A XLAlignVert value that specifies the position of the image in the cell. |
| ImageScaling | scale | An ImageScaling value that specifies the image scaling within the cell. |
This constructor automatically calculates the image size, position, and clipping based on the cell and image sizes and on the given alignment and scaling parameters.
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLSheet sheet, string source, int x, int y, int width, int height)
Public Sub New(sheet As XLSheet, source As String, x As Integer, y As Integer, width As Integer, height As Integer)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| string | source | Text source as file path or base64 string data. |
| int | x | The horizontal position of the image with respect to the sheet, in twips. |
| int | y | The vertical position of the image with respect to the sheet, in twips. |
| int | width | The width of the image, in twips. |
| int | height | The height of the image, in twips. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(XLSheet sheet, string source, RectangleF rc)
Public Sub New(sheet As XLSheet, source As String, rc As RectangleF)
| Type | Name | Description |
|---|---|---|
| XLSheet | sheet | XLSheet object that owns the new shape. |
| string | source | Text source as file path or base64 string data. |
| RectangleF | rc | The rectangle that specifies the image size and position with respect to the cell, in twips. |