From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing colors in a picture control

Hi all,

 

I'm running into some performance issues with the frequent updating of colors in a picture control. This is the method I'm currently using to update the colors.

The picture contains only two colors; the color of the icon, and the pane color to mimic transparency.

color change.png

 

is this method possibly too slow and could be the culprit of perfomance issues, and is there a better way of doing this?

 

Thanks

______________________________________________________________


______________________________________________________________
0 Kudos
Message 1 of 3
(2,521 Views)

Hi Gazebo,

 

a loop-less approach:

check.png

It's not perfect as it creates datacopies and has a coercion dot inside, but may provide ideas!

 

You may even use ReshapeArray to work with a 1D array (in the core of the routine), LabVIEW usually is faster then…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(2,492 Views)

you could get rid of one for loop and both the unflatten-pixmap.vi, if you used the image array from the image data cluster.

2015-05-05_replace-color.png

 

 

 

 

Message 3 of 3
(2,490 Views)