TextureAlignment

TextureAlignment enumeration

يحدد محاذاة بلاط تعبئة الملمس.

public enum TextureAlignment

قيم

اسمقيمةوصف
TopLeft0محاذاة الملمس في أعلى اليسار.
Top1محاذاة الملمس العلوي.
TopRight2محاذاة الملمس في أعلى اليمين.
Left3محاذاة الملمس إلى اليسار.
Center4محاذاة الملمس المركزي.
Right5محاذاة الملمس إلى اليمين.
BottomLeft6محاذاة الملمس في أسفل اليسار.
Bottom7محاذاة الملمس السفلي.
BottomRight8محاذاة الملمس في أسفل اليمين.
None9لا يوجد محاذاة للملمس.

أمثلة

يوضح كيفية ملء وتوزيع الملمس داخل الشكل.

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

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

// تطبيق محاذاة الملمس على تعبئة الشكل.
shape.Fill.PresetTextured(PresetTexture.Canvas);
shape.Fill.TextureAlignment = TextureAlignment.TopRight;

// استخدم خيار التوافق لتحديد الشكل باستخدام DML إذا كنت تريد الحصول على "TextureAlignment"
//الخاصية بعد حفظ المستند.
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);

أنظر أيضا