Click here to Skip to main content
15,560,987 members
Home / Discussions / C#
   

C#

 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 5:39
Hagen McCarthy11-May-12 5:39 
GeneralRe: Picturebox and Progressbar question Pin
Sentenryu11-May-12 6:06
Sentenryu11-May-12 6:06 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 6:10
Hagen McCarthy11-May-12 6:10 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 6:21
Hagen McCarthy11-May-12 6:21 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 5:59
Hagen McCarthy11-May-12 5:59 
AnswerRe: Picturebox and Progressbar question Pin
BobJanova11-May-12 7:37
BobJanova11-May-12 7:37 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy11-May-12 8:37
Hagen McCarthy11-May-12 8:37 
AnswerRe: Picturebox and Progressbar question Pin
Alan N11-May-12 8:28
Alan N11-May-12 8: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 8:38
Hagen McCarthy11-May-12 8:38 
GeneralRe: Picturebox and Progressbar question Pin
Dave Kreskowiak12-May-12 5:33
mveDave Kreskowiak12-May-12 5:33 
GeneralRe: Picturebox and Progressbar question Pin
Hagen McCarthy14-May-12 3:27
Hagen McCarthy14-May-12 3:27 
QuestionWeb Camera Application using C# Pin
austinwales11-May-12 4:14
austinwales11-May-12 4:14 
AnswerRe: Web Camera Application using C# Pin
Ravi Bhavnani11-May-12 4:25
professionalRavi Bhavnani11-May-12 4:25 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 5:41
Sentenryu11-May-12 5:41 
AnswerRe: Web Camera Application using C# Pin
Eddy Vluggen11-May-12 6:46
professionalEddy Vluggen11-May-12 6:46 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 7:53
Sentenryu11-May-12 7:53 
AnswerRe: Web Camera Application using C# Pin
Eddy Vluggen11-May-12 9:02
professionalEddy Vluggen11-May-12 9:02 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 9:39
Sentenryu11-May-12 9:39 
AnswerRe: Web Camera Application using C# Pin
Ravi Bhavnani11-May-12 10:01
professionalRavi Bhavnani11-May-12 10:01 
GeneralRe: Web Camera Application using C# Pin
Sentenryu11-May-12 10:23
Sentenryu11-May-12 10:23 
GeneralRe: Web Camera Application using C# Pin
Ravi Bhavnani11-May-12 10:25
professionalRavi Bhavnani11-May-12 10:25 
GeneralRe: Web Camera Application using C# Pin
austinwales13-May-12 8:30
austinwales13-May-12 8:30 
GeneralRe: Web Camera Application using C# Pin
Ravi Bhavnani13-May-12 8:41
professionalRavi Bhavnani13-May-12 8:41 
GeneralRe: Web Camera Application using C# Pin
austinwales24-May-12 1:13
austinwales24-May-12 1:13 
QuestionRegex for String.Contains Pin
amrok2amrokk11-May-12 0:09
amrok2amrokk11-May-12 0: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.