Hi
I replaced this file with this code:
using SkiaSharp;
using SkiaSharp.Views.Forms;
using System.IO;
using System.Reflection;
namespace SkiaSharpFormsDemos.Curves
{
public partial class BezierCurvePage : InteractivePage
{
SKBitmap resourceBitmap;
public BezierCurvePage()
{
string resourceID = "SkiaSharpFormsDemos.Media.Banana.jpg";
Assembly assembly = GetType().GetTypeInfo().Assembly;
using (Stream stream = assembly.GetManifestResourceStream(resourceID))
{
resourceBitmap = SKBitmap.Decode(stream);
}
touchPoints = new TouchPoint[2];
touchPoints[0] = new TouchPoint(50, 50);
touchPoints[1] = new TouchPoint(350, 350);
InitializeComponent();
baseCanvasView = canvasView;
}
void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
{
SKSurface surface = args.Surface;
SKCanvas canvas = surface.Canvas;
canvas.Clear();
SKRect rect = new SKRect(touchPoints[0].Center.X, touchPoints[0].Center.Y, touchPoints[1].Center.X, touchPoints[1].Center.Y);
// canvas.DrawBitmap(resourceBitmap, rect); // works
canvas.DrawBitmap(resourceBitmap, rect, BitmapStretch.Uniform); // does not work
foreach (TouchPoint touchPoint in touchPoints)
{
touchPoint.Paint(canvas);
}
}
}
}
When using BitmapStretch.Uniform bitmap angles are drawn away from touch points. (line 31).
How to make bitmap in the correct positions for touch points?
Thanks