[]
Fills the specified shape with small tiles of an image.
Use this method to apply a texture fill from an image file. The image is tiled across the shape instead of being stretched as a single picture.
void UserTextured(string fileName)
Sub UserTextured(fileName As String)
| Type | Name | Description |
|---|---|---|
| string | fileName | The name of the picture file. |
IShape shape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
IFillFormat fillFormat = shape.Fill;
string imagePath = CreateSampleImageFile();
try
{
fillFormat.UserTextured(imagePath);
}
finally
{
if (File.Exists(imagePath))
{
File.Delete(imagePath);
}
}
| Type | Condition |
|---|---|
| IOException | if the picture file cannot be read. |
Fills the specified shape with small tiles of an image.
Use this method to apply a texture fill from an image stream. The
type parameter specifies the ImageType of the image data
in the stream.
void UserTextured(Stream stream, ImageType type)
Sub UserTextured(stream As Stream, type As ImageType)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream of the picture file. |
| ImageType | type | The ImageType of the stream. |
IShape shape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
IFillFormat fillFormat = shape.Fill;
using (MemoryStream stream = CreateSampleImageStream())
{
fillFormat.UserTextured(stream, ImageType.PNG);
}