Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
تعمل مقتطفات الشيفرة التالية أيضًا مع مكتبة Aspose.PDF.Drawing .
المنحنى Curve هو اتحاد متصل من الخطوط الإسقاطية، حيث يلتقي كل خط بثلاثة خطوط أخرى في نقاط مزدوجة عادية.
يوضح Aspose.PDF for .NET كيفية استخدام منحنيات بيزير في الرسوم البيانية الخاصة بك. تستخدم منحنيات بيزير على نطاق واسع في الرسوميات الحاسوبية لنمذجة المنحنيات السلسة. يتم احتواء المنحنى بالكامل في الغلاف المحدب لنقاط التحكم الخاصة به، ويمكن عرض النقاط رسوميًا واستخدامها للتلاعب بالمنحنى بشكل بديهي. يتم احتواء المنحنى بالكامل في الرباعي الذي تكون زواياه هي النقاط الأربعة المعطاة (غلافها المحدب).
في هذا المقال، سنستكشف منحنيات الرسوم البيانية البسيطة، والمنحنيات المملوءة، التي يمكنك إنشاؤها في مستند PDF الخاص بك.
اتبع الخطوات أدناه:
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ExampleCurve()
{
// The path to the document directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Images();
// Create PDF document
using (var document = new Aspose.Pdf.Document())
{
// Add page
var page = document.Pages.Add();
// Create Drawing object with certain dimensions
var graph = new Aspose.Pdf.Drawing.Graph(400, 200);
// Set border for Drawing object
var borderInfo = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, Aspose.Pdf.Color.Green);
graph.Border = borderInfo;
// Create a curve and set its properties
var curve1 = new Aspose.Pdf.Drawing.Curve(new float[] { 10, 10, 50, 60, 70, 10, 100, 120 })
{
GraphInfo =
{
Color = Aspose.Pdf.Color.GreenYellow
}
};
// Add the curve to the graph shapes
graph.Shapes.Add(curve1);
// Add Graph object to paragraphs collection of page
page.Paragraphs.Add(graph);
// Save PDF document
document.Save(dataDir + "DrawingCurve1_out.pdf");
}
}
تظهر الصورة التالية النتيجة الناتجة عن تنفيذ مقتطف الشيفرة الخاص بنا:
يوضح هذا المثال كيفية إضافة كائن منحنى مملوء باللون.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void CurveFilled()
{
// The path to the document directory
var dataDir = RunExamples.GetDataDir_AsposePdf_Images();
// Create PDF document
using (var document = new Aspose.Pdf.Document())
{
// Add page
var page = document.Pages.Add();
// Create Drawing object with certain dimensions
var graph = new Aspose.Pdf.Drawing.Graph(400, 200);
// Set border for Drawing object
var borderInfo = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.All, Aspose.Pdf.Color.Green);
graph.Border = borderInfo;
// Create a curve and set fill color
var curve1 = new Aspose.Pdf.Drawing.Curve(new float[] { 10, 10, 50, 60, 70, 10, 100, 120 })
{
GraphInfo =
{
FillColor = Aspose.Pdf.Color.GreenYellow
}
};
// Add the curve to the graph shapes
graph.Shapes.Add(curve1);
// Add Graph object to paragraphs collection of page
page.Paragraphs.Add(graph);
// Save PDF document
document.Save(dataDir + "DrawingCurve2_out.pdf");
}
}
انظر إلى نتيجة إضافة منحنى مملوء:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.