Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
0
Reply
PictureBox doesn't load image?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Quang Dinh Luong
8y
457
1
Reply
I wrote this:
int abc = 0;
foreach
(SubPod subPod
in
pod.SubPods)
{
//rtbLoG.Text += subPod.Title + Environment.NewLine;
//rtbLoG.Text += subPod.Plaintext + Environment.NewLine;
//rtbLoG.ScrollToCaret();
//pictureBox1.ImageLocation = subPod.Image.Src;
WebClient webClient =
new
WebClient();
webClient.DownloadFile(
new
Uri(subPod.Image.Src.Trim()), @
"Pictures\\" + abc + "
.png");
Form newForm =
new
Form();
newForm.Size =
new
Size((subPod.Image.Width) + 10, (subPod.Image.Height) + 37);
//10,37
newForm.MaximizeBox =
false
;
newForm.MinimizeBox =
false
;
newForm.Text = subPod.Title;
newForm.StartPosition = FormStartPosition.Manual;
newForm.ShowIcon =
false
;
newForm.ShowInTaskbar =
false
;
newForm.TopMost =
true
;
newForm.MinimumSize = newForm.Size;
PictureBox newImage =
new
PictureBox();
newImage.ImageLocation = @
"Pictures\\" + abc + "
.png";
newImage.Dock = DockStyle.Fill;
newImage.SizeMode = PictureBoxSizeMode.Zoom;
newImage.MouseDown +=
new
MouseEventHandler(newImage_MouseDown);
newImage.CancelAsync();
newForm.Controls.Add(newImage);
newForm.Show();
abc++;
}
abc = 0;
The debug process OK, but it runs poorly. Images are not loaded, the windows contain them freeze, I tried both load directly using Image.Load(src) and indirectly (as above - download then load) but it still not load.
Any suggestion? The code is a mess, sorry :P
I also attached the entire code, so you can see the error clearly.
P/s: Click record (wait for a second) and ask sth like: WHo is Bill Gates? It will load the code above and you will understand the error
Attachment:
consciousness.rar
Post
Reset
Cancel
Answers (
0
)
Next Recommended Forum
Error - XML NamespaceManager is needed!
Access to the path 'C:\inetpub\IDMS\Development\Web.sitemap'