469,306 Members | 2,579 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Load image into a variable and this set it = to picturebox image.

If I have the image 'Myimage.gif' in my application directory,
how do I load this image into a variable,
and then... set this = to a picturebox image property.

I do not want to directly assign the image.
Nov 21 '05 #1
4 9763
Dim myImage as new System.Drawing.Bitmap("myPath\myimage.gif")

"Peter" <pe***@mclinn.com> wrote in message
news:dc**************************@posting.google.c om...
If I have the image 'Myimage.gif' in my application directory,
how do I load this image into a variable,
and then... set this = to a picturebox image property.

I do not want to directly assign the image.

Nov 21 '05 #2
* pe***@mclinn.com (Peter) scripsit:
If I have the image 'Myimage.gif' in my application directory,
how do I load this image into a variable,
and then... set this = to a picturebox image property.


\\\
Me.PicturBox1.Image = Image.FromFile("C:\foobar.gif")
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #3
Herfried,

What was it with you yesterday, mix up seconds with minutes.
And here mix up controls with variables.
?
:-)

Cor
* pe***@mclinn.com (Peter) scripsit:
If I have the image 'Myimage.gif' in my application directory,
how do I load this image into a variable,
and then... set this = to a picturebox image property.


\\\
Me.PicturBox1.Image = Image.FromFile("C:\foobar.gif")
///

Nov 21 '05 #4
* "Cor Ligthert" <no**********@planet.nl> scripsit:
What was it with you yesterday, mix up seconds with minutes.
And here mix up controls with variables.
?
:-)


Well, I did some optimization and got rid of the variable... ;-).
If I have the image 'Myimage.gif' in my application directory,
how do I load this image into a variable,
and then... set this = to a picturebox image property.


\\\
Me.PicturBox1.Image = Image.FromFile("C:\foobar.gif")
///


--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Fritz Switzer | last post: by
1 post views Thread by marco | last post: by
2 posts views Thread by marco | last post: by
reply views Thread by poojo hackma | last post: by
4 posts views Thread by Bob | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.