1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
| SKBitmap bmp = new(width, height);
SKCanvas canvas = new(bmp);
canvas.Clear(SKColor.Parse("#fff"));
SKPaint paint = new()
{
Color = SKColors.White.WithAlpha(100),
IsAntialias = true ,
StrokeWidth = 3,
ColorF = SKColor.Parse("#000"),
TextSize=textSize,
TextAlign=SKTextAlign.Center,
Typeface = SKTypeface.FromFamilyName(fontFamilyName, SKFontStyle.Bold)
};
canvas.DrawText(LogoText,width/2.0f,height/2.0f,paint);
canvas.DrawPath(path,paint);
var skrect = new SKRect(left,top,right,bottom);
canvas.DrawArc(skrect,0,180,true,paint);
SKFileWStream fs = new("cover.jpg");
bmp.Encode(fs, SKEncodedImageFormat.Jpeg, quality: 50);
bmp.Display();
|