|
Re: SWT 4.25 ToolBar ToolItem icon image wrong transparent color [message #1855041 is a reply to message #1854944] |
Sun, 25 September 2022 19:23 |
Andy Maleh Messages: 75 Registered: March 2020 Location: Montreal, Quebec, Canada |
Member |
|
|
It works fine for me under SWT 4.25
Here is Hello, Tool Bar! working on Linux, Mac, and Windows with cut/copy/paste images having transparency show the grey color of the window beneath:
https://imgur.com/a/JwSA0Pr
Linux:
Mac:
Windows:
The GUI code in Glimmer DSL for SWT (equivalent to the Java code you shared):
tool_bar {
tool_item {
image File.expand_path('./images/cut.png', __dir__), height: 16
}
tool_item {
image File.expand_path('./images/copy.png', __dir__), height: 16
}
tool_item {
image File.expand_path('./images/paste.png', __dir__), height: 16
}
tool_item(:separator)
combo {
selection <=> [self, :font_size]
}
}
Full code: https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/samples/hello/hello_tool_bar.rb
What operating system are you encountering the problem on?
Could it be you are using an image without proper transparency?
EclipseCon / EclipseWorld / Agile Conference Speaker
Open-Source Software Author of Glimmer DSL for SWT
|
|
|
|
|
|
|
|
Re: SWT 4.25 ToolBar ToolItem icon image wrong transparent color [message #1855370 is a reply to message #1855369] |
Mon, 10 October 2022 23:59 |
Andy Maleh Messages: 75 Registered: March 2020 Location: Montreal, Quebec, Canada |
Member |
|
|
I just also noticed that the way Glimmer DSL for SWT builds the image internally by default is different from your code in building the Image.
Here is the image-building JRuby code that is inside the Glimmer DSL for SWT framework, simplified a bit for sharing:
image_data = ImageData.new(file_path)
swt_image = Image.new(DisplayProxy.instance.swt_display, image_data)
The gist of the code is that it builds ImageData from the file first, and then it builds the Image. I wonder if that better respects the Image transparency if it contained any.
Try to do the equivalent of that in your Java code too and see if it makes a difference.
EclipseCon / EclipseWorld / Agile Conference Speaker
Open-Source Software Author of Glimmer DSL for SWT
[Updated on: Tue, 11 October 2022 00:01] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04254 seconds