Exemplo n.º 1
0
 private static void ApplyChunkToLayer(Layer layer, SKRectI rect, Surface chunk)
 {
     layer.DynamicResizeAbsolute(rect.ToInt32Rect());
     using var snapshot = chunk.SkiaSurface.Snapshot();
     layer.LayerBitmap.SkiaSurface.Canvas.DrawImage(snapshot, new SKPoint(rect.Left - layer.OffsetX, rect.Top - layer.OffsetY), Surface.ReplacingPaint);
     layer.InvokeLayerBitmapChange(rect.ToInt32Rect());
 }
Exemplo n.º 2
0
 public void TestThatSKRectIToInt32RectWorks()
 {
     SKRectI rect = new SKRectI(5, 2, 8, 10);
     Int32Rect converted = rect.ToInt32Rect();
     Assert.Equal(rect.Left, converted.X);
     Assert.Equal(rect.Top, converted.Y);
     Assert.Equal(rect.Width, converted.Width);
     Assert.Equal(rect.Height, converted.Height);
 }