PicStretch module

class PicStretch.PicStretch

Bases: SpireObject

Represents picture stretching settings for a fill picture in Excel.

This class encapsulates the properties that control how a picture is stretched or positioned when used as a fill for shapes, cells, or other Excel objects. It allows for configuring the picture’s positioning, scaling, and display type.

property Bottom: float

Gets or sets the bottom offset of the picture as a percentage of the fill area.

A value of 1.0 aligns the bottom edge of the picture with the bottom edge of the fill area. Values are between 0.0 and 1.0, where 1.0 represents 100% of the fill area height.

Returns:

The bottom offset as a decimal value.

Return type:

float

property Left: float

Gets or sets the left offset of the picture as a percentage of the fill area.

A value of 0.0 aligns the left edge of the picture with the left edge of the fill area. Values are between 0.0 and 1.0, where 1.0 represents 100% of the fill area width.

Returns:

The left offset as a decimal value.

Return type:

float

property Right: float

Gets or sets the right offset of the picture as a percentage of the fill area.

A value of 1.0 aligns the right edge of the picture with the right edge of the fill area. Values are between 0.0 and 1.0, where 1.0 represents 100% of the fill area width.

Returns:

The right offset as a decimal value.

Return type:

float

property Scale: float

Gets or sets the scale factor for the picture.

A value of 1.0 represents 100% (original size). Values greater than 1.0 enlarge the picture, while values less than 1.0 reduce it.

Returns:

The scale factor as a decimal value.

Return type:

float

property Top: float

Gets or sets the top offset of the picture as a percentage of the fill area.

A value of 0.0 aligns the top edge of the picture with the top edge of the fill area. Values are between 0.0 and 1.0, where 1.0 represents 100% of the fill area height.

Returns:

The top offset as a decimal value.

Return type:

float

property Type: FillPictureType

Gets or sets the type of picture fill.

Determines how the picture is displayed within the filled area, such as stretched, tiled, or positioned at specific locations.

Returns:

An enumeration value representing the picture fill type.

Return type:

FillPictureType