[]
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(Image img, int x, int y)
Type | Name | Description |
---|---|---|
Image | 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.
[CLSCompliant(false)]
public XLPictureShape(Image img, int x, int y, int width, int height)
Type | Name | Description |
---|---|---|
Image | 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.
[CLSCompliant(false)]
public XLPictureShape(Image img, RectangleF rc)
Type | Name | Description |
---|---|---|
Image | 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.
[CLSCompliant(false)]
public XLPictureShape(Image img)
Type | Name | Description |
---|---|---|
Image | img | The image contained in the new XLPictureShape. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(Image img, Size cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Type | Name | Description |
---|---|---|
Image | img | The GrapeCity.Documents.Drawing.Image contained in the new XLPictureShape. |
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.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, Image img, int x, int y, int width, int height)
Type | Name | Description |
---|---|---|
XLSheet | sheet | XLSheet object that owns the new shape. |
Image | 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, Image img, RectangleF rc)
Type | Name | Description |
---|---|---|
XLSheet | sheet | XLSheet object that owns the new shape. |
Image | 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(GcBitmap bitmap, int x, int y)
Type | Name | Description |
---|---|---|
GcBitmap | bitmap | The GcBitmap 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.
[CLSCompliant(false)]
public XLPictureShape(GcBitmap bitmap, int x, int y, int width, int height)
Type | Name | Description |
---|---|---|
GcBitmap | bitmap | The GcBitmap 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.
[CLSCompliant(false)]
public XLPictureShape(GcBitmap bitmap, RectangleF rc)
Type | Name | Description |
---|---|---|
GcBitmap | bitmap | The GcBitmap 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.
[CLSCompliant(false)]
public XLPictureShape(GcBitmap bitmap)
Type | Name | Description |
---|---|---|
GcBitmap | bitmap | The GcBitmap image source. |
Initializes a new instance of an XLPictureShape.
[CLSCompliant(false)]
public XLPictureShape(GcBitmap bitmap, Size cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Type | Name | Description |
---|---|---|
GcBitmap | bitmap | The GcBitmap 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.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, GcBitmap bitmap, int x, int y, int width, int height)
Type | Name | Description |
---|---|---|
XLSheet | sheet | XLSheet object that owns the new shape. |
GcBitmap | bitmap | The GcBitmap 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.
[CLSCompliant(false)]
public XLPictureShape(XLSheet sheet, GcBitmap bitmap, RectangleF rc)
Type | Name | Description |
---|---|---|
XLSheet | sheet | XLSheet object that owns the new shape. |
GcBitmap | bitmap | The GcBitmap 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, int x, int y)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
Type | Name | Description |
---|---|---|
Stream | stream | The stream with image source. |
Initializes a new instance of an XLPictureShape.
public XLPictureShape(Stream stream, Size cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Type | Name | Description |
---|---|---|
Stream | stream | The stream with 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, Stream stream, int x, int y, int width, int height)
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)
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)
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)
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)
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)
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, Size cellSize, XLAlignHorz align, XLAlignVert valign, ImageScaling scale)
Type | Name | Description |
---|---|---|
string | source | Text source as file path or base64 string data. |
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, string source, int x, int y, int width, int height)
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)
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. |