471,852 Members | 915 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

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 10311
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
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.