10-23-2024 04:36 AM - edited 10-23-2024 04:40 AM
I want to use a tree control with custom symbols. I have prepared some png images to be used:
They look fine here with the native resolution of 16x16. They are created in Adobe Illustrator and exported as png with a resolution of 72 ppi.
When I read them into Labview and displayed in a picture they come out with very low quality:
It seems like anti-aliasing or transparency is removed or something. Changing the Transparency Thres input of the Read PNG File.vi doesn't do the quality any good.
How can I get the same quality as the actual images in LabVIEW? I have attached the images.
Solved! Go to Solution.
10-23-2024 05:04 AM - edited 10-23-2024 05:12 AM
Use vi.lib\picture\PNG\Draw Flattened Blended Pixmap.vi
(found out about it here: Create pictures with different opacity levels, there since LV2020)
10-23-2024 06:19 AM
I succeeded to have the result from the video only by wiring the 24-bit pixmap to the Convolution.vi that I called only once with Y input {0 -1 0} {-1 4 -1} {0 -1 0}
10-23-2024 06:41 AM
can't download the files (probably need to be registered to lavag?)
10-23-2024 06:49 AM
@cordm ha scritto:
Use vi.lib\picture\PNG\Draw Flattened Blended Pixmap.vi
(found out about it here: Create pictures with different opacity levels, there since LV2020)
Thank you, this function works great to get the images on a picture control. However, I want to have these images as symbols for a tree control. Setting the raw png image data as the custom symbols still gave the low quality symbols.
I found the solution however by converting the image data to pixmap using the "blended pixmap.vi" and converting it back to image data:
Now the symbols look great!
10-23-2024 08:17 AM
I didn't really understand the difference between the two. When should I use Draw Flattened Blended Pixmap.vi and when should I use Draw Flattened Pixmap.vi
10-23-2024 09:57 AM
Be aware that Picture to Pixmap cannot export alpha channel information. The image is blended (as the name suggests).
So if your particular tree cell has a different background color, you would need to create a filled rectangle with that color. Otherwise, you get your symbol on a white box on a green cell.
10-23-2024 10:14 AM
@maxnoder1995 wrote:
I didn't really understand the difference between the two. When should I use Draw Flattened Blended Pixmap.vi and when should I use Draw Flattened Pixmap.vi
If you have a png with an alpha channel, the background will shine through. With Draw Flattened Pixmap, you get 1-bit transparency: either fully transparent or fully opaque.
A gradient from red to fully transparent will look like this (front panel set to white background):