Hi there
I’m trying to draw a rectangle with rounded corners and fill it. The rounded rectangle renders, but the fill does not. What am I missing? Below is my code.
Many thanks, Brett.
public static void CreateRoundedBoxSample(Stream stream)
{
SetLicense();
var document = new Document();
var page = document.Pages.Add();
var width = 100f;
var height = 100f;
var left = 100f;
var top = 100f;
var radius = 15f;
var box = new FloatingBox { Left = left, Top = top };
var graph = new Aspose.Pdf.Drawing.Graph(width, height);
var shape = new Aspose.Pdf.Drawing.Rectangle(0, 0, width, height)
{
GraphInfo = new GraphInfo
{
Color = Color.Black,
FillColor = Color.Blue
},
RoundedCornerRadius = radius
};
graph.Shapes.Add(shape);
box.Paragraphs.Add(graph);
page.Paragraphs.Add(box);
document.Save(stream);
}