Border radius: added example

This commit is contained in:
MarcinZiabek
2021-12-30 21:07:34 +01:00
committed by Marcin Ziąbek
parent b8ea30be23
commit 7cc272ff9e
3 changed files with 59 additions and 44 deletions
+46
View File
@@ -0,0 +1,46 @@
using Microcharts;
using NUnit.Framework;
using QuestPDF.Examples.Engine;
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using SkiaSharp;
namespace QuestPDF.Examples
{
public class CanvasExamples
{
[Test]
public void BorderRadius()
{
RenderingTest
.Create()
.PageSize(400, 600)
.ProducePdf()
.ShowResults()
.Render(container =>
{
container
.Background(Colors.White)
.Padding(25)
.Box()
.Layers(layers =>
{
layers.PrimaryLayer().Padding(10).Text("Sample text");
layers.Layer().Canvas((canvas, size) =>
{
using var paint = new SKPaint
{
Color = SKColor.Parse(Colors.Black),
IsStroke = true,
StrokeWidth = 1
};
canvas.DrawRoundRect(0, 0, size.Width, size.Height, 20, 20, paint);
});
});
});
}
}
}