ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278k

How to show image for 10 second period then will be null aft

Mar 28 2019 11:11 AM
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
  1. 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
  1. if(new image retrieved )   
  2. {   
  3. show it per 10 second    
  4. }   
  5. if(after 10 second no image retrived)  
  6.  {  
  7.  picturebox1.image=null;  
  8.  }   
  9. if(new image retrieved by timercount)   
  10. {   
  11. not wait until 10 second display for current image  
  12.  }  
can you help me or give me idea for that please ?

What I have tried:
  1. private void TimerCount_Tick(object sender, EventArgs e) 
  2. {
  3.     TimerCount.Start(); 
  4.     GetMembersDataImage();     
  5. }  
  1.   public void GetMembersData()  
  2.        {  
  3.             string sqlGetLast = @"select isnull((select top 1 MemberCode from members order by MemberCode desc),1) ";  
  4.              MemberCode = Utilities.ObjectConverter.ConvertToInteger(DataAccess.ExecuteScalar(sqlGetLast));  
  5.             string sqlImage = "select MemberImage FROM Members WHERE MemberCode =" + MemberCode + "";  
  6.             if (Utilities.ObjectConverter.ConvertToString(DataAccess.ExecuteScalar(sqlImage)) != "")  
  7.             {  
  8.                 byte[] MemberImage = (byte[])DataAccess.ExecuteScalar(sqlImage);  
  9.                 Gate1Pic.Image = ByteArrayToImagebyMemoryStream(MemberImage);  
  10.             }  
  11. }  

Answers (1)