如何在draw2d图形上指定透明背景颜色?

发布于 2024-08-15 06:04:23 字数 507 浏览 3 评论 0原文

我正在编写一个 Eclipse 插件,并将一些简单的图形(即视图元素)分层在一起以创建图表。

一个简单的组件看起来像这样

一个具有渲染问题的简单组件 http://img115.yfrog。 com/img115/4946/componentwithopacity.jpg

右侧的鼓图标是一个小部件抽屉的一部分。

它下面的不完整线试图代表多样性,但它被小部件抽屉挡住了。

我非常努力地在图形上获得透明背景,但 SWT 颜色类无法指定 alpha 或透明颜色。

以前有人遇到过这个问题吗?我怎样才能使我的draw2d图形背景透明,这样我就可以看到它后面的东西。

这是我遇到的各种其他不透明度相关问题的一个小例子。解决这个问题将解决广泛的视觉问题。

非常感谢任何帮助。 简历

I'm writing an eclipse plugin, and I'm layering some simple figures (i.e. view elements) together to create diagrams.

A simple component looks like this

A simple component with rendering issues http://img115.yfrog.com/img115/4946/componentwithopacity.jpg

The drum icon on the right is part of a tiny widget drawer.

And the incomplete line underneath it is trying to represent multiplicity, but it's being blocked by the widget drawer.

I tried really hard to get a transparent background on the Figure, but the SWT colour class has no way to specify an alpha or transparent colour.

has anyone run into this problem before? How can I make my draw2d Figure background transparent so I can see stuff behind it.

This a small example of various other opacity related issues I've encountered. Solving this would fix a wide range of visual issues.

Any help is greatly appreciated.
CV

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

各自安好 2024-08-22 06:04:23

那么 IFigure.setOpaque(false) 不这样做吗?

So IFigure.setOpaque(false) doesn't do it?

撩动你心 2024-08-22 06:04:23

只需根据您的喜好将 alpha 设置为 0 到 255 即可。在绘制事件期间参见 Graphics#setAlpha(int) 或参见 Shape - 我认为 setAlpha(int) 也存在于其中。

Simply set the alpha from 0 to 255 to your liking. See Graphics#setAlpha(int) during your paint event or see Shape - I think setAlpha(int) exists there too.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文