[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IFillFormat.UserTextured

UserTextured Method

UserTextured(string)

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.

Declaration
void UserTextured(string fileName)
Sub UserTextured(fileName As String)
Parameters
Type Name Description
string fileName

The name of the picture file.

Examples
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);
    }
}
Exceptions
Type Condition
IOException

if the picture file cannot be read.

UserTextured(Stream, ImageType)

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.

Declaration
void UserTextured(Stream stream, ImageType type)
Sub UserTextured(stream As Stream, type As ImageType)
Parameters
Type Name Description
Stream stream

The stream of the picture file.

ImageType type

The ImageType of the stream.

Examples
IShape shape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
IFillFormat fillFormat = shape.Fill;
using (MemoryStream stream = CreateSampleImageStream())
{
    fillFormat.UserTextured(stream, ImageType.PNG);
}