TextureAlignment

TextureAlignment enumeration

Anger justeringen för texturfyllningens kakelsättning.

public enum TextureAlignment

Värderingar

namnVärdeBeskrivning
TopLeft0Texturjustering övre vänstra.
Top1Justering av övre textur.
TopRight2Texturjustering övre högra.
Left3Vänster texturjustering.
Center4Centrera texturjustering.
Right5Höger texturjustering.
BottomLeft6Texturjustering längst ner till vänster.
Bottom7Justering av bottentextur.
BottomRight8Texturjustering längst ner till höger.
None9Ingen texturjustering.

Exempel

Visar hur man fyller och kaklar texturen inuti formen.

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

Shape shape = builder.InsertShape(ShapeType.Rectangle, 80, 80);

// Tillämpa texturjustering på formfyllningen.
shape.Fill.PresetTextured(PresetTexture.Canvas);
shape.Fill.TextureAlignment = TextureAlignment.TopRight;

// Använd alternativet compliance för att definiera formen med DML om du vill få "TextureAlignment"
// egenskap efter att dokumentet har sparats.
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions { Compliance = OoxmlCompliance.Iso29500_2008_Strict };

doc.Save(ArtifactsDir + "Shape.TextureFill.docx", saveOptions);

doc = new Document(ArtifactsDir + "Shape.TextureFill.docx");
shape = (Shape)doc.GetChild(NodeType.Shape, 0, true);

Assert.AreEqual(TextureAlignment.TopRight, shape.Fill.TextureAlignment);
Assert.AreEqual(PresetTexture.Canvas, shape.Fill.PresetTexture);

Se även