TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Quang Dinh Luong
NA
76
18.8k
PictureBox doesn't load image?
Mar 27 2016 10:24 AM
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
Reply
Answers (
0
)
Error - XML NamespaceManager is needed!
Access to the path 'C:\inetpub\IDMS\Development\Web.sitemap'