Click here to Skip to main content
15,884,237 members
Home / Discussions / C#
   

C#

 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 4:39
Hagen McCarthy11-May-12 4:39 
GeneralRe: Picturebox and Progressbar question Pin
Sentenryu11-May-12 5:06
Sentenryu11-May-12 5:06 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 5:10
Hagen McCarthy11-May-12 5:10 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 5:21
Hagen McCarthy11-May-12 5:21 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 4:59
Hagen McCarthy11-May-12 4:59 
AnswerRe: Picturebox and Progressbar question Pin
BobJanova11-May-12 6:37
BobJanova11-May-12 6:37 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 7:37
Hagen McCarthy11-May-12 7:37 
AnswerRe: Picturebox and Progressbar question Pin
Alan N11-May-12 7:28
Alan N11-May-12 7:28 
Member 8956301 wrote:
// display image in picture box
pictureBox1.Image = new Bitmap(open.FileName);
pictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
pictureBox1.WaitOnLoad = false;
pictureBox1.LoadAsync(open.FileName);


OK, let's break this code down line by line
1) Open the file, create a bitmap and set as the picturebox image
2) Set size mode
3) tell picturebox that future image loading will be async
4) Do async load from the file, this is now reloading

So you are loading the image twice.

I think all you need is
C#
pictureBox1.WaitOnLoad = false;
pictureBox1.LoadAsync(open.FileName);


Alan.
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 7:38
Hagen McCarthy11-May-12 7:38 
GeneralRe: Picturebox and Progressbar question Pin
Dave Kreskowiak12-May-12 4:33
mveDave Kreskowiak12-May-12 4:33 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy14-May-12 2:27
Hagen McCarthy14-May-12 2:27 
QuestionWeb Camera Application using C# Pin
austinwales11-May-12 3:14
austinwales11-May-12 3:14 
AnswerRe: Web Camera Application using C# Pin
Ravi Bhavnani11-May-12 3:25
professionalRavi Bhavnani11-May-12 3:25 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 4:41
Sentenryu11-May-12 4:41 
AnswerRe: Web Camera Application using C# Pin
Eddy Vluggen11-May-12 5:46
professionalEddy Vluggen11-May-12 5:46 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 6:53
Sentenryu11-May-12 6:53 
AnswerRe: Web Camera Application using C# Pin
Eddy Vluggen11-May-12 8:02
professionalEddy Vluggen11-May-12 8:02 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 8:39
Sentenryu11-May-12 8:39 
AnswerRe: Web Camera Application using C# Pin
Ravi Bhavnani11-May-12 9:01
professionalRavi Bhavnani11-May-12 9:01 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 9:23
Sentenryu11-May-12 9:23 
GeneralRe: Web Camera Application using C# Pin
Ravi Bhavnani11-May-12 9:25
professionalRavi Bhavnani11-May-12 9:25 
GeneralRe: Web Camera Application using C# Pin
austinwales13-May-12 7:30
austinwales13-May-12 7:30 
GeneralRe: Web Camera Application using C# Pin
Ravi Bhavnani13-May-12 7:41
professionalRavi Bhavnani13-May-12 7:41 
GeneralRe: Web Camera Application using C# Pin
austinwales24-May-12 0:13
austinwales24-May-12 0:13 
QuestionRegex for String.Contains Pin
amrok2amrokk10-May-12 23:09
amrok2amrokk10-May-12 23:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.