473,703 Members | 5,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do we load an image file into a picturebox in code ?

C.K
How do I load an image file , e.g.

C:\images\img1. jpg

into a PictureBox, but in code ?

Tia
C.K
Nov 21 '05 #1
14 20510
* "C.K" <assdadad> scripsit:
How do I load an image file , e.g.

C:\images\img1. jpg

into a PictureBox, but in code ?


\\\
Me.PictureBox1. Image = Image.FromFile( "C:\foo.bmp ")
///

--
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 #2
A complete overview how to set an image in a imagebox

http://msdn.microsoft.com/library/de...imagetopic.asp

I hope this helps?

Cor
Nov 21 '05 #3
PictureBox1.Ima ge = Image.FromFile( "C:\myFile.???" )
--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"C.K" <assdadad> wrote in message
news:uK******** ******@TK2MSFTN GP11.phx.gbl...
How do I load an image file , e.g.

C:\images\img1. jpg

into a PictureBox, but in code ?

Tia
C.K

Nov 21 '05 #4
Your message came really late this time Terry

Cor
Nov 21 '05 #5
Ha Ha, I just wanted to do a Herfired in reverse, I knew you would spot that
!

LOL

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:Ot******** *****@TK2MSFTNG P12.phx.gbl...
Your message came really late this time Terry

Cor

Nov 21 '05 #6
* "Cor Ligthert" <no**********@p lanet.nl> scripsit:
Your message came really late this time Terry


Do you have a problem with that? I don't.

--
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 #7
>
Do you have a problem with that? I don't.


Beg your pardon, and should that be of any interest.

Calling me a spammer in the other thread and telling that you will throw me
out of this newsgroup in the same way as you did with Fergus Cooney shows
exactly what OHM all the time is telling, I did not believe it, however he
is right.



Nov 21 '05 #8
C.K
Thanks to all, you are really helping me a lot.
C.K
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:eU******** ******@TK2MSFTN GP14.phx.gbl...
A complete overview how to set an image in a imagebox

http://msdn.microsoft.com/library/de...imagetopic.asp
I hope this helps?

Cor

Nov 21 '05 #9
* "Cor Ligthert" <no**********@p lanet.nl> scripsit:
Do you have a problem with that? I don't.


Beg your pardon, and should that be of any interest.

Calling me a spammer in the other thread and telling that you will throw me
out of this newsgroup in the same way as you did with Fergus Cooney shows
exactly what OHM all the time is telling, I did not believe it, however he
is right.


I don't kick out anybody. I didn't kick out Fergus Cooney. He kicked
out himself. You are welcome, but I'd like that you stop making stupid
comments about me and some other people in the group.

But however, I think that there are more interesting questions to be
answered and more interesting topics to be discussed.

EOT

--
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 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
31804
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and help. Regards
0
1345
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 different methods to display an image on the PDA. They work fine, but I need to click a button first (for example a radio button) for the image to display. I'd simply like to show the image as soon as the program starts. If I use the following...
3
21347
by: user | last post by:
Hello I finally managed to save Bitmap that reprezented my pictureBox to jpg file, but now how can i load from that file to Bitmap again ? Bitmap does not have any Load or Open method (like Save...). Thanx Michal
12
6186
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 the DLL above. Now the application, together with the above DLL’s is successfully loading a TIF image file (62992 x 113386 Pixels, Huffman RLE compression, 3200 x 3200 DPI resolution, binary colored (1 Bit Per Pixel), file on disk size 43.08...
3
4089
by: tedqn | last post by:
I'm using VS 2005. When user selects a image from the FileListBox, the code is PictureBox.ImageLocation = sFullPath PictureBox is set to AutoSize. When the newly loaded image is smaller than the panel size, I want to center it within the panel by calculating and move the box to a location other than (0,0). The
4
7331
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 moment i use FromFile, but sometimes, i have an error saying that the file is all ready in use (can happen or not, and never at the same moment...) If i use FromStream, and if i set the Enabled property to false, if another
2
7048
by: Marcolino | last post by:
Hy Guys, I have a problem loading JPG in a Picture Box. I need to load a jpg files into a PB and then unlock the original JPG. I'm using following code: Dim picture1 As PictureBox Dim OriginalImage As New Bitmap(FilePath) 'Load orginal JPG Dim iImage As New Bitmap(OriginalImage) 'Copy ii into a
1
3525
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 script so firstly i need to be able to load the picture i want to the page first.. in VS the code is
5
23899
krungkrung
by: krungkrung | last post by:
hi again to everyone! I made a simple program(for my VB.Net practice). The program loads an image file to a picturebox upon clicking a button. after loading the image file i have another button to delete the loaded image file from the directory. But I have a problem deleting the image file used by the picturebox even if I set the "PictureBox1.Image = Nothing" before deletion takes place. The error says, "The process cannot access the file...
0
9266
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9127
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9020
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7878
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6602
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3128
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.