473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 10697
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: jez | last post by:
I'm programming in C# for a PPC, and trying to display an image from the start, i.e. as soon as the program launches. I've tried (as explained in Microsoft's .NET Compact Framework book) to use two...
1
by: Fritz Switzer | last post by:
With two controls a PictureBox and another "PictureBox like" , Pic2, a control from a dll, I'm stuck on cannot implicity convert System.Drawing.Image to System.Drawing.Bitmap error. How do I...
1
by: marco | last post by:
I'm a newbie and i'm doing a little application that open image. I don't understand what i've to do to have a zoom of an image...i don't know where's the error. If anyone know a simple code tell me...
2
by: marco | last post by:
I'm a newbie and i'm doing a little application in C# for a Pocket PC that open image. I don't understand what i've to do to have a zoom of an image...i don't know where's the error. If anyone...
12
by: Sharon | last post by:
I’m wrote a small DLL that used the FreeImage.DLL (that can be found at http://www.codeproject.com/bitmap/graphicsuite.asp). I also wrote a small console application in C++ (unmanaged) that uses...
14
by: C.K | last post by:
How do I load an image file , e.g. C:\images\img1.jpg into a PictureBox, but in code ? Tia C.K
0
by: poojo hackma | last post by:
How can I load a System Resource image into a PictureBox with the CLR? Code: //----------------------------------------- System::Windows::Forms::PictureBox^ PictureBox1; System::IO::Stream^...
4
by: Bob | last post by:
Hi, I have a pictureBox. What is the most efficient way to load an image (png) : FromFile or FromStream ? The picture Box is set to Visible = True or Visible = False at the run time. For the...
1
by: Rishi Boparai | last post by:
Hi, in Visual Studios there's this tool called PictureBox rite...but in Visual Web developer i can't seem to find it.. i'm using Visual Web Developer...VB language..to make a watermarking...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.