static Matrix3x2 GetDisplayTransform(CanvasControl canvas) { var outputSize = canvas.Size.ToVector2(); var sourceSize = new Vector2(canvas.ConvertPixelsToDips(simulationW), canvas.ConvertPixelsToDips(simulationH)); return(Utils.GetDisplayTransform(outputSize, sourceSize)); }
public bool IsZoomable(Single scale) { CanvasControl canvas = this.GetCanvas(); if (canvas != null) { Single maxSize = canvas.ConvertPixelsToDips(canvas.Device.MaximumBitmapSizeInPixels); return(canvas.Width * scale <= maxSize && canvas.Height * scale <= maxSize); } return(false); }