Back to DOM
PictureOrTextureFillClass
Definition
- Namespace
- DOM.Elements.Graphics.Colors
- Assembly
- DOM.dll
Represents a picture or texture fill that uses an image as its source.
Remarks
paints an area with an image. It supports transparency, rotation with the shape, a fill rectangle for positioning, a tile definition for repeated rendering, and an optional duo-tone effect that maps the image onto two colors. PictureOrTextureFill It is attached to a via . Fill Fill.PictureOrTextureFill
Examples
csharp
1// 1. Simple picture fill
2var fill = new PictureOrTextureFill { Picture = new Image("background.png") };
3
csharp
1// 2. Semi-transparent fill
2var fill = new PictureOrTextureFill
3{
4 Picture = new Image("watermark.png"),
5 Transparency = new Percentage(70)
6};
7
csharp
1// 3. Tiled fill
2var fill = new PictureOrTextureFill
3{
4 Picture = new Image("pattern.png"),
5 FillTile = new FillTile { ScaleX = new Percentage(50), ScaleY = new Percentage(50) }
6};
7
csharp
1// 4. Duo-tone fill (image mapped onto two colors)
2var fill = new PictureOrTextureFill
3{
4 Picture = new Image("texture.png"),
5 DuoTone = new List<IDuoTone>
6 {
7 new DuoTone { Color1 = new Color("#0B1F3A"), Color2 = new Color("#F2C57C") }
8 }
9};
10
csharp
1// 5. Fill fixed to a sub-rectangle
2var fill = new PictureOrTextureFill
3{
4 Picture = new Image("logo.png"),
5 FillRect = new FillToRectangle { Top = 10, Left = 10, Right = 90, Bottom = 90 }
6};
7
Properties
DuoToneIDuoTone
Gets or sets the duo-tone mapping applied to the fill image.
FillRectFillToRectangle
Gets or sets the rectangle that defines the region receiving the fill.
FillTile
Gets or sets the tiling configuration for the fill.
PictureImage
Gets or sets the image used as the fill source.
RotateWithShape
Gets or sets a value indicating whether the fill should rotate together with the shape.
TransparencyPercentage
Gets or sets the transparency percentage applied to the fill.