Example #1
0
 private void CanvasControl_Draw(CanvasControl sender, CanvasDrawEventArgs args)
 {
     if (currentTile == null)
     {
         args.DrawingSession.Clear(Windows.UI.Colors.CornflowerBlue);
     }
     else
     {
         if (GeometryDecoder.renderList != null)
         {
             System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
             stopwatch.Start();
             //var size = sender.Size;
             //args.DrawingSession.Transform = System.Numerics.Matrix3x2.CreateRotation(angle, new System.Numerics.Vector2((float)size.Width/2f, (float)size.Height/2f));
             args.DrawingSession.Transform = System.Numerics.Matrix3x2.CreateScale(tileScale, canvasScalePoint) * System.Numerics.Matrix3x2.CreateTranslation(canvasOffset);
             args.DrawingSession.DrawImage(GeometryDecoder.renderList);
             GeometryDecoder.ApplyTextLayer(args.DrawingSession);
             args.DrawingSession.DrawImage(GeometryDecoder.renderText);
             stopwatch.Stop();
             System.Diagnostics.Debug.WriteLine($"Render time: {stopwatch.ElapsedMilliseconds} ms");
         }
     }
 }