Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
problem

How to show image for 10 second period then will be null After that ?

I have TimerCount on windows form get last image on table members every second

and this is work success using windows form timer on visual studio 2017 .

and I need when new image retrieved show this image for 10 second then make it null

C#
picturebox1.image=null


After that will be null in case of not new image retrieved

and within 10 second if new image retrieved by TimerCount not wait for ten second

show image per 10 second only if no image retrieved within ten second

and if after 10 second no image retrieved set image to null ?

pseudo code
if(new image retrieved )
{
show it per 10 second 
}
if(after 10 second no image retrived)
{
picturebox1.image=null;
}
if(new image retrieved by timercount)
{
not wait until 10 second display for current image
}

can you help me or give me idea for that please ?

What I have tried:

C#
private void TimerCount_Tick(object sender, EventArgs e)
        {
           
            TimerCount.Start();
            GetMembersDataImage();
               
        }
Posted
Updated 28-Mar-19 5:37am
v2

1 solution

DON'T USE TIMERS. Timer events are the lowest priority event on a Windows system. Use threading to do this. In fact, try using a BackgroundWorker objecvt to marshall image display. If that doesn't work, move to threading. If you can't manage that, try the React framework (google is your friend).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900