Hi Team,
To to fill the Orange color inside dots, I am using this namespace Microsoft.Maui.Graphics
----------
using System;
using System.IO;
// These packages are available on NuGet
using Microsoft.Maui.Graphics;
using Microsoft.Maui.Graphics.Skia;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
// Create a bitmap in memory and draw on its Canvas
SkiaBitmapExportContext bmp = new(1000, 1000, 1.0f);
ICanvas canvas = bmp.Canvas;
// Draw a big blue rectangle with a dark border
Rect backgroundRectangle = new(0, 0, bmp.Width, bmp.Height);
//canvas.FillColor = Color.FromArgb("#e39e00");
canvas.FillRectangle(backgroundRectangle);
canvas.StrokeColor = Colors.Black;
canvas.StrokeSize = 1;
canvas.DrawRectangle(backgroundRectangle);
IPattern pattern;
SolidPaint solidPaint = new SolidPaint(Colors.Red);
// Create a 10x10 template for the pattern
using (PictureCanvas picture = new PictureCanvas(0, 0, 100, 100))
{
picture.StrokeColor = Colors.Orange;
picture.FontColor = Color.FromRgba("#e39e00");
picture.DrawCircle(50, 50, 25);
picture.DisplayScale = 1;
picture.FillColor = Colors.Red;
pattern = new PicturePattern(picture.Picture, 10, 10);
}
// Fill the rectangle with the 10x10 pattern
PatternPaint patternPaint = new PatternPaint
{
Pattern = pattern,ForegroundColor= Colors.Red,
};
canvas.SetFillPaint(patternPaint, RectF.Zero);
canvas.FillRectangle(backgroundRectangle);
// Save the image as a PNG file
bmp.WriteToFile("console2.png");
}
}
}