TextureIndex

TextureIndex enumeration

Especifica la textura de sombreado.

public enum TextureIndex

Valores

NombreValorDescripción
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
TextureNil65535Especifica que no se utilizará ningún patrón en la región sombreada actual (es decir, el patrón deberá ser un relleno completo con el color de fondo).

Ejemplos

Muestra cómo decorar texto con bordes y sombreado.

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");

Muestra cómo aplicar un borde de contorno a una tabla.

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

// Alinea la tabla con el centro de la página.
table.Alignment = TableAlignment.Center;

// Borra los bordes y sombreados existentes de la tabla.
table.ClearBorders();
table.ClearShading();

// Agrega bordes verdes al contorno de la tabla.
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);

// Rellena las celdas con un color sólido verde claro.
table.SetShading(TextureIndex.TextureSolid, Color.LightGreen, Color.Empty);

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

Ver también