简体   繁体   English

Java SWT:使用GC.drawline时更改线条颜色

[英]Java SWT: Change colour of line when using GC.drawline

If I am drawing a line using: 如果我使用以下方法画一条线:

GC.drawLine(int x1, int y1, int x2, int y2);

How do I change the colour of the line? 如何更改线条的颜色?

I can change the transparency by calling: 我可以通过以下方式更改透明度:

gc.setAlpha(150);

But I cannot find method of changing the colour of the line 但是我找不到改变线条颜色的方法

绘制函数使用前景色绘制:

gc.setForeground(display.getSystemColor(SWT.COLOR_BLUE));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM