public static RotateAt ( Matrix &matrix, double angle, double centerX, double centerY ) : void | ||
matrix | Matrix | |
angle | double | |
centerX | double | |
centerY | double | |
return | void |
private static void UpdateRenderTransform(UIElement renderedGeometry, IViewport viewport) { var matrix = XamlMedia.Matrix.Identity; if (viewport.IsRotated) { var center = viewport.WorldToScreen(viewport.Center); MatrixHelper.RotateAt(ref matrix, viewport.Rotation, center.X, center.Y); } renderedGeometry.RenderTransform = new XamlMedia.MatrixTransform { Matrix = matrix }; }
private static XamlMedia.Matrix CreateTransformMatrix1(IViewport viewport) { var matrix = XamlMedia.Matrix.Identity; var mapCenterX = viewport.Width * 0.5; var mapCenterY = viewport.Height * 0.5; MatrixHelper.Translate(ref matrix, mapCenterX - viewport.Center.X, mapCenterY - viewport.Center.Y); if (viewport.IsRotated) { MatrixHelper.RotateAt(ref matrix, -viewport.Rotation); } MatrixHelper.ScaleAt(ref matrix, 1 / viewport.Resolution, 1 / viewport.Resolution, mapCenterX, mapCenterY); // This will invert the Y axis, but will also put images upside down MatrixHelper.InvertY(ref matrix, mapCenterY); return(matrix); }
private static XamlMedia.Matrix CreatePointSymbolMatrix(double resolution, SymbolStyle symbolStyle) { var matrix = XamlMedia.Matrix.Identity; MatrixHelper.InvertY(ref matrix); var centerX = symbolStyle.SymbolOffset.X; var centerY = symbolStyle.SymbolOffset.Y; var scale = symbolStyle.SymbolScale; MatrixHelper.Translate(ref matrix, centerX, centerY); MatrixHelper.ScaleAt(ref matrix, scale, scale); //for point symbols we want the size to be independent from the resolution. We do this by counter scaling first. if (symbolStyle.UnitType != UnitType.WorldUnit) { MatrixHelper.ScaleAt(ref matrix, resolution, resolution); } MatrixHelper.RotateAt(ref matrix, -symbolStyle.SymbolRotation); return(matrix); }