将点从坐标系屏幕转换为x y

时间:2013-05-29 12:35:46

标签: system frame coordinate

将点从坐标系转换为java,

Java框架中的

+ ------- X | | | ÿ

我想要它作为这个

ÿ | | + ------ X

请帮帮我

1 个答案:

答案 0 :(得分:0)

您可以更改它,让y = Ymax - y

  public void paintControl(PaintEvent e) {
        Canvas canvas = (Canvas) e.widget;
        int maxX = canvas.getSize().x - 20;
        int maxY = canvas.getSize().y - 20;
        e.gc.setForeground(e.display.getSystemColor(SWT.COLOR_BLUE));
        int h = 0;
        int pixelCount = 4;
        e.gc.drawLine(50, maxY, maxX, maxY);

        e.gc.drawLine(50, maxY, 50, 0 + 20);