Changed SKGLView and Gradient test
* Fixed to call SKObject.Dispose
This commit is contained in:
Родитель
f129f3f62f
Коммит
fdce8d7333
|
@ -19,7 +19,7 @@
|
|||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<skia:SKCanvasView
|
||||
<skia:SKGLView
|
||||
Grid.Column="0" Grid.Row="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.RowSpan="2"
|
||||
|
@ -70,11 +70,11 @@
|
|||
Increment="1"
|
||||
Maximum="100"
|
||||
Value="45"/>
|
||||
<WebView
|
||||
<!--<WebView
|
||||
Grid.Column="1"
|
||||
Grid.ColumnSpan="2"
|
||||
Grid.Row="4"
|
||||
Source="www.google.com"/>
|
||||
Source="www.google.com"/>-->
|
||||
<Label
|
||||
Grid.Column="0" Grid.Row="5"
|
||||
Text="{Binding Source={x:Reference entry}, Path=Text}"
|
||||
|
|
|
@ -22,11 +22,20 @@ namespace Xamarin.Forms.ControlGallery.WinForms
|
|||
System.Windows.Forms.MessageBox.Show("Clicked!");
|
||||
}
|
||||
|
||||
private void SKCanvasView_PaintSurface(object sender, SkiaSharp.Views.Forms.SKPaintSurfaceEventArgs e)
|
||||
private void SKCanvasView_PaintSurface(object sender, SkiaSharp.Views.Forms.SKPaintGLSurfaceEventArgs e)
|
||||
{
|
||||
var p = new SKPaint();
|
||||
p.Color = SKColors.Aqua;
|
||||
e.Surface.Canvas.DrawCircle(100, 100, 20, p);
|
||||
e.Surface.Canvas.Clear(SKColors.White);
|
||||
using (var p = new SKPaint())
|
||||
using (var shader = SKShader.CreateLinearGradient(
|
||||
new SKPoint(0.0f, 0.0f),
|
||||
new SKPoint(100.0f, 100.0f),
|
||||
new [] { SKColors.Red, SKColors.Green },
|
||||
null,
|
||||
SKShaderTileMode.Clamp))
|
||||
{
|
||||
p.Shader = shader;
|
||||
e.Surface.Canvas.DrawRect(new SKRect(0.0f, 0.0f, 100.0f, 100.0f), p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace Xamarin.Forms.ControlGallery.WinForms
|
|||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
OpenTK.Toolkit.Init();
|
||||
|
||||
System.Windows.Forms.Application.EnableVisualStyles();
|
||||
System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче