如何将画布的 x,y 原点更改为左下角并翻转 y 坐标? [英] How to change x,y origin of canvas to bottom left and flip the y coordinates?

查看:43
本文介绍了如何将画布的 x,y 原点更改为左下角并翻转 y 坐标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一堆数据点,我想将它们双向绑定到画布上的点.

I have a bunch of data points that I would like to two-way bind to points on a canvas.

假设较大的 y 值的点像大多数数学图一样反映在向上的方向上.

The points assume larger y values are reflected in an upwards direction like most math graphs.

如何将画布的 x,y 原点更改为左下角并反转它对 y 坐标的解释?

How do I change the x,y origin of the canvas to the bottom left corner and reverse it's interpretation of the y coordinate?

(我想留在 XAML)

(I would like to stay in XAML)

推荐答案

<Canvas>
    <Canvas.LayoutTransform>
        <ScaleTransform ScaleX="1" ScaleY="-1" CenterX=".5" CenterY=".5" />
    </Canvas.LayoutTransform>
</Canvas>

这篇关于如何将画布的 x,y 原点更改为左下角并翻转 y 坐标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆