SWT anti-aliasing control shapes

∥☆過路亽.° 提交于 2019-12-11 01:57:48

问题


I have a NO_TRIM shell with rounded corners, created by applying a Region. The problem is, I'd like the edges of the shell to be anti-aliased, which I don't know how to do with applying a Region or any other way.

Right now I have this:

shell.addPaintListener(new PaintListener() {
    public void paintControl(PaintEvent e) {
        setRoundedShape(shell, 10);
    }
});

//...

void setRoundedShape(Control control, int r) {
    Region region = new Region(control.getDisplay());
    // ...
    control.setRegion(region);
    region.dispose();
}

I know about GC.setAntialias(SWT.ON) but I don't see how to use it to shape a control. Please help...

来源:https://stackoverflow.com/questions/17249992/swt-anti-aliasing-control-shapes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!