44 строки
733 B
Markdown
44 строки
733 B
Markdown
---
|
|
uti: com.xamarin.workbook
|
|
platforms:
|
|
- Console
|
|
packages:
|
|
- id: SkiaSharp.Svg
|
|
version: 1.56.1
|
|
- id: SkiaSharp
|
|
version: 1.56.1
|
|
---
|
|
|
|
```csharp
|
|
#r "SkiaSharp"
|
|
#r "SkiaSharp.Svg"
|
|
#load "SkiaSharp.csx"
|
|
|
|
using SkiaSharp;
|
|
```
|
|
|
|
```csharp
|
|
var bitmap = new SKBitmap(256, 256);
|
|
var canvas = new SKCanvas(bitmap);
|
|
|
|
canvas.Clear(SKColors.Transparent);
|
|
```
|
|
|
|
```csharp
|
|
canvas.Clear(SKColors.Transparent);
|
|
|
|
var paint = new SKPaint {
|
|
IsAntialias = true,
|
|
TextSize = 50,
|
|
TextAlign = SKTextAlign.Center,
|
|
Color = 0xFF3498DB, // Xamarin light blue
|
|
Style = SKPaintStyle.Fill,
|
|
Typeface = SKTypeface.FromFamilyName("Trebuchet")
|
|
};
|
|
|
|
canvas.DrawText("SkiaSharp", 128, 128 + (paint.TextSize / 2), paint);
|
|
```
|
|
|
|
```csharp
|
|
bitmap
|
|
``` |