TextureIndex

TextureIndex enumeration

Spécifie la texture d’ombrage.

public enum TextureIndex

Valeurs

NomÉvaluerLa description
Texture10Percent3
Texture12Pt5Percent37
Texture15Percent38
Texture17Pt5Percent39
Texture20Percent4
Texture22Pt5Percent40
Texture25Percent5
Texture27Pt5Percent41
Texture2Pt5Percent35
Texture30Percent6
Texture32Pt5Percent42
Texture35Percent43
Texture37Pt5Percent44
Texture40Percent7
Texture42Pt5Percent45
Texture45Percent46
Texture47Pt5Percent47
Texture50Percent8
Texture52Pt5Percent48
Texture55Percent49
Texture57Pt5Percent50
Texture5Percent2
Texture60Percent9
Texture62Pt5Percent51
Texture65Percent52
Texture67Pt5Percent53
Texture70Percent10
Texture72Pt5Percent54
Texture75Percent11
Texture77Pt5Percent55
Texture7Pt5Percent36
Texture80Percent12
Texture82Pt5Percent56
Texture85Percent57
Texture87Pt5Percent58
Texture90Percent13
Texture92Pt5Percent59
Texture95Percent60
Texture97Pt5Percent61
TextureCross24
TextureDarkCross18
TextureDarkDiagonalCross19
TextureDarkDiagonalDown16
TextureDarkDiagonalUp17
TextureDarkHorizontal14
TextureDarkVertical15
TextureDiagonalCross25
TextureDiagonalDown22
TextureDiagonalUp23
TextureHorizontal20
TextureNone0
TextureSolid1
TextureVertical21
TextureNil65535Spécifie qu’aucun motif ne doit être utilisé sur la région ombrée actuelle (c’est-à-dire que le motif doit être un remplissage complet avec la couleur d’arrière-plan).

Exemples

Montre comment décorer du texte avec des bordures et des ombrages.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

BorderCollection borders = builder.ParagraphFormat.Borders;
borders.DistanceFromText = 20;
borders[BorderType.Left].LineStyle = LineStyle.Double;
borders[BorderType.Right].LineStyle = LineStyle.Double;
borders[BorderType.Top].LineStyle = LineStyle.Double;
borders[BorderType.Bottom].LineStyle = LineStyle.Double;

Shading shading = builder.ParagraphFormat.Shading;
shading.Texture = TextureIndex.TextureDiagonalCross;
shading.BackgroundPatternColor = Color.LightCoral;
shading.ForegroundPatternColor = Color.LightSalmon;

builder.Write("This paragraph is formatted with a double border and shading.");
doc.Save(ArtifactsDir + "DocumentBuilder.ApplyBordersAndShading.docx");

Montre comment appliquer une bordure de contour à un tableau.

Document doc = new Document(MyDir + "Tables.docx");
Table table = doc.FirstSection.Body.Tables[0];

// Aligne le tableau au centre de la page.
table.Alignment = TableAlignment.Center;

// Supprime toutes les bordures et tous les ombrages existants du tableau.
table.ClearBorders();
table.ClearShading();

// Ajoute des bordures vertes au contour du tableau.
table.SetBorder(BorderType.Left, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Right, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Top, LineStyle.Single, 1.5, Color.Green, true);
table.SetBorder(BorderType.Bottom, LineStyle.Single, 1.5, Color.Green, true);

// Remplit les cellules avec une couleur unie vert clair.
table.SetShading(TextureIndex.TextureSolid, Color.LightGreen, Color.Empty);

doc.Save(ArtifactsDir + "Table.SetOutlineBorders.docx");

Voir également