Page.BackgroundColor
محتويات
[
يخفي
]Page.BackgroundColor property
يحصل أو يضبط لون خلفية الصفحة.
public Color BackgroundColor { get; set; }
أمثلة
يوضح كيفية ضبط لون خلفية الصفحة.
// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_Pages();
// تحميل مستند OneNote والحصول على العنصر الفرعي الأول.
Document document = new Document(Path.Combine(dataDir, "Aspose.one"));
foreach (var page in document)
{
page.BackgroundColor = Color.BlueViolet;
}
document.Save(Path.Combine(dataDir, "SetPageBackgroundColor.one"));
يظهر كيفية تطبيق نمط السمة الداكنة على مستند.
// المسار إلى دليل المستندات.
string dataDir = RunExamples.GetDataDir_Text();
// حمّل المستند إلى Aspose.Note.
Document doc = new Document(Path.Combine(dataDir, "Aspose.one"));
foreach (var page in doc)
{
page.BackgroundColor = Color.Black;
}
foreach (var node in doc.GetChildNodes<RichText>())
{
var c = node.ParagraphStyle.FontColor;
if (c.IsEmpty || Math.Abs(c.R - Color.Black.R) + Math.Abs(c.G - Color.Black.G) + Math.Abs(c.B - Color.Black.B) <= 30)
{
node.ParagraphStyle.FontColor = Color.White;
}
}
doc.Save(Path.Combine(dataDir, "AsposeDarkTheme.pdf"));
انظر أيضًا
- class Page
- namespace Aspose.Note
- assembly Aspose.Note