[xamarin] SKShader Class
컴퓨터 이야기/xamarin2020. 5. 9. 10:54
Table Of Contens 1. SkShader Class Example |
1. SkShader Class Example
public void FillSpotGradient(SKCanvas canvas, float width, float height)
{
float selectedSize = Math.Min(width, height);
// create the shader
var colors = new SKColor[]
{
new SKColor(0, 255, 255),
new SKColor(255, 0, 255),
new SKColor(255, 255, 0),
new SKColor(0, 255, 255)
};
var shader = SKShader.CreateSweepGradient
(
new SKPoint(width / 3, height / 3),
colors,
null
);
// use the shader
var paint = new SKPaint
{
Shader = shader
};
canvas.DrawPaint(paint);
}
2. Reference
https://docs.microsoft.com/en-us/dotnet/api/skiasharp.skshader?view=skiasharp-1.68.1
'컴퓨터 이야기 > xamarin' 카테고리의 다른 글
[xamarin]Android icon folder (0) | 2020.06.03 |
---|---|
[xamarin]embedded resource로 mp3 등록 하여 소리내기 (0) | 2020.06.02 |
[xamarin] Screen Tap Event Handler (0) | 2020.05.14 |
[svg] SVG 파일을 만들어 주는 곳 (0) | 2020.05.14 |
[xamarin] How to load file .svg with SkiaSharp on Xamarin forms? (0) | 2020.05.13 |