LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch image too slow

Hello ,

I need to use different images to represent the different measure status, and use "SetCtrlBitmap()" to do switch between different images , but I find that the switch speed is slow , especially when the application run a long term time . Is there any other way to accelerate the different image switch on a picture control ? Thanks.

David
0 Kudos
Message 1 of 3
(2,670 Views)
David,

The SetCtrlBitmap fuction should be fast enough for most applications. Doing some tests here I could switch a large image about 10 times per second with no problem.

An important trick is to load the bitmaps first and then switch the images. For example if you are going to work with 5 different images, just load these 5 images when loading the panel and when you want to switch the image you call "SetCtrlBitmap" only. Also make sure that you call DiscardBitmap on the bitmaps that you load when closing the panel.

If this is still slow you could give a try to use a canvas control instead.... it may take some extra work.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 2 of 3
(2,670 Views)
I am using bitmap in a table control. When user double clicks in a cell,
I display a check mark (like list control). No problems so far. May want
to call ProcessDrawEvents just in case.


vishi

JuanCarlos wrote:
> David,
>
> The SetCtrlBitmap fuction should be fast enough for most applications.
> Doing some tests here I could switch a large image about 10 times per
> second with no problem.
>
> An important trick is to load the bitmaps first and then switch the
> images. For example if you are going to work with 5 different images,
> just load these 5 images when loading the panel and when you want to
> switch the image you call "SetCtrlBitmap" only. Also make sure that
> you call DiscardBitmap on the bitmaps that you load when closing the
> panel.
>
>
If this is still slow you could give a try to use a canvas control
> instead.... it may take some extra work.
>
> I hope this helps.
>
> Regards,
>
> Juan Carlos
> N.I.
0 Kudos
Message 3 of 3
(2,670 Views)