[]
Specifies how a background image is positioned, scaled, or tiled within its destination rectangle.
Use this enum with BackgroundImageLayout to control whether the image keeps its aspect ratio, stretches to fill the bounds, fills with clipping, centers within the destination rectangle, or tiles across it.
public enum ImageLayout
Public Enum ImageLayout
string imagePath = Path.Combine("Users", "DefaultApps", "Documents", "logo.png");
IBackgroundPicture picture = worksheet.BackgroundPictures.AddPicture(imagePath, 10, 10, 120, 80);
picture.BackgroundImageLayout = ImageLayout.ZoomToFill;
| Name | Description |
|---|---|
| Center | Specifies the image is centered within the destination rectangle. |
| None | Specifies the image is left-aligned at the top across the destination rectangle. |
| Stretch | Specifies the image is resized to fill the destination dimensions. The aspect ratio is not preserved. |
| Tile | Specifies the image is tiled to fill destination dimensions. |
| Zoom | Specifies the image is resized to fit in the destination dimensions while it preserves its native aspect ratio. |
| ZoomToFill | Specifies the image is resized to fill the destination dimensions while it preserves its native aspect ratio. If the aspect ratio of the destination rectangle differs from the source, the source content is clipped to fit in the destination dimensions. |