473,378 Members | 1,470 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

problem in picture displaying

i display a pic on picture box and then i want to display another pic after some seconds
but problem is that first image is not displaying only display 2nd image

1... display first picture from database such as
pbThumbImage.Image = new Bitmap(new MemoryStream(objEmployee.Picture));

2... and then get the reference of current main thread
Thread main = Thread.CurrentThread;
Thread.Sleep(5000);

3.. and then display another pic
pbThumbImage.Image = global::TimeEntrySystem.Properties.Resources.Defau ltImage;

but problem is that first image is not displaying only display 2nd image
Aug 11 '08 #1
4 1657
Hey buddy

Try this

Expand|Select|Wrap|Line Numbers
  1. pbThumbImage.Image = new Bitmap(new MemoryStream(objEmployee.Picture));
  2. Application.DoEvents();
  3. Thread.Sleep(5000);
  4. pbThumbImage.Image = global::TimeEntrySystem.Properties.Resources.DefaultImage;
Hope that helps

i display a pic on picture box and then i want to display another pic after some seconds
but problem is that first image is not displaying only display 2nd image

1... display first picture from database such as
pbThumbImage.Image = new Bitmap(new MemoryStream(objEmployee.Picture));

2... and then get the reference of current main thread
Thread main = Thread.CurrentThread;
Thread.Sleep(5000);

3.. and then display another pic
pbThumbImage.Image = global::TimeEntrySystem.Properties.Resources.Defau ltImage;

but problem is that first image is not displaying only display 2nd image
Aug 11 '08 #2
thanks to answer my question
buddy problem is solved

but there is an other problem when 1st pic is display , also a string is also display which blink through timer event but now this string not blink
Aug 11 '08 #3
Can you post the piece of code here

thanks to answer my question
buddy problem is solved

but there is an other problem when 1st pic is display , also a string is also display which blink through timer event but now this string not blink
Aug 11 '08 #4
tlhintoq
3,525 Expert 2GB
I suspect the source of your problem is that you are putting the tread to sleep. When its asleep its not doing anything, including painting your dialog, updating your string etc. Its not a counter or wait function.

Many ways around it but here's one suggestion:
A timer with a 1000 interval (milliseconds therefore this is 1 second interval)
Set a counter to however many seconds you want to wait.
Decrement it and update your status string on each tick.
When your counter hits zero... Do something such as change the image.
Aug 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Joan | last post by:
I am creating a word document from an asp page. I have no problems actaully creating the document and creating some tables that have data in them. I am using Response.ContentType =...
6
by: Nutshell | last post by:
Hi, I created a web page which contains table. I use table cells to display a picture using <img src>. The problem is that some pictures are not being fully displayed, only a quarter of the left...
1
by: Rob Parker | last post by:
I posted this (with a different subjetc line) in the ms.public.access.forms newsgroup a few days ago, but haven't had a single response there. I'm hoping maybe someone here can help. Using...
1
by: Rob Parker | last post by:
I posted this with a different subject line (in two posts - I added additional info in the second) in this newsgroup a few days ago, but haven't had a single response. Hopefully, that was because...
2
by: Lyn | last post by:
What is the best way to import a picture (bmp format) via VBA from a Windows file and embed it into a Bound Object Frame (and thence to an OLE Object in a table)? I found an MS knowledge base...
14
by: hamil | last post by:
I am trying to display an image in a picture box. The image is a group 4 fax black and white image of a piece of sheet music. The original resolution is 300 X 300 dpi. I want to have the picture...
3
by: velu | last post by:
Asp.Net 2 I am trying to display Image from Northwind Database. I ran a queary "SELECT CategoryID, CategoryName, Description, Picture FROM Categories" but the Dataview displayes all the fields...
4
by: janie66 | last post by:
Hi guys Can anyone please help me out i need to display image on form .i have a requirment iam pulling data from query... PRDID PRDNAME PRDPIC 01 XYX ...
19
by: Jim | last post by:
Hi, I have two questions/problems pertaining to CSS horizontal dropdown menus and am hoping that someone here can help me out. (1) I'm having a problem centering the menu. I picked up the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.