Thank you for reminding of this event.:)
I've tried the method.
And if I delete the last code, I can also make it.:)
Like this
Image mapImage = Image.FromFile (imageFileNames[i]);
Graphics graphics = this.splitContainer1.Panel1.CreateGraphics();
graphics.Clear(this.splitContainer1.Panel1.BackCol or);
graphics.DrawImage(mapImage, 10, 10, 50, 50);
//this.splitContainer1.Panel1.Invalidate();
"Kevin Spencer" wrote:
You have to draw it in the OnPaint method or the Paint event handler for the
Control.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
Networking Components, Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Kun Niu" <Ku****@discussions.microsoft.comwrote in message
news:26**********************************@microsof t.com...
Dear all,
I'm new here and I'm sorry to trouble.
But I've got the following problem when trying to draw a PNG file on a
panel.
My code is like this:
Image mapImage = Image.FromFile (imageFileNames[i]);
Graphics graphics = this.splitContainer1.Panel1.CreateGraphics();
graphics.Clear(this.splitContainer1.Panel1.BackCol or);
graphics.DrawImage(mapImage, 10, 10, 50, 50);
this.splitContainer1.Panel1.Invalidate();
I can see that my imageFileNames[i] is correct.
But the image fails to appear on the screen.
Would anyone please help me out?
Thanks in advance.