Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Show Image For 10 Second Period Then Will Be Null After That ?

Status
Not open for further replies.

engsalah2018

Technical User
Sep 10, 2018
5
0
0
EG

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



Code:
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 ?

Code:
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:



Code:
Code:
private void TimerCount_Tick(object sender, EventArgs e)

        {

            

            TimerCount.Start();

            GetMembersDataImage();

                

        }


Code:
public void GetMembersData()

       {

            string sqlGetLast = @"select isnull((select top 1 MemberCode from members order by MemberCode desc),1) ";

             MemberCode = Utilities.ObjectConverter.ConvertToInteger(DataAccess.ExecuteScalar(sqlGetLast));

            string sqlImage = "select MemberImage FROM Members WHERE MemberCode =" + MemberCode + "";

            if (Utilities.ObjectConverter.ConvertToString(DataAccess.ExecuteScalar(sqlImage)) != "")

            {

                byte[] MemberImage = (byte[])DataAccess.ExecuteScalar(sqlImage);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top