Le réseau pour les développeurs >
Forums - Accueil
>
Visual C# Language
>
how to load an image in visual c# 2008
how to load an image in visual c# 2008
- hi am lina and am a new learner or user of visual c# and i've been told that it can read image files easier than visual c++ because the library files for loading images are embeded within the prgram , so i need a little help or hints about the code for that
Réponses
- Hi,
Yes that's correct.
For example you can use
Image i=Image.FromFile(@"C:\sample.jpg");
and you can save Images just calling Save method. like i.Save
Here you can get more information from these links.
http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image_members.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image_methods.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image_properties.aspx- Marqué comme réponseYichun_FengMSFT, Modérateurvendredi 13 novembre 2009 04:46
- Image class is in System.Drawing namespace. If your project does not have the reference you should add the reference.
If you have the reference you should declare using System.Drawing at the top of your cs file or declare image as System.Drawing.Image in code.
There is no one code to use Image class in c# there are million of requirements, million of things you can do.
You can start with reading some documents, articles, papers to get the main idea. And when you have questions you can ask here too. But it's hard to write that million things in a single thread.
You can start reading the documentation on msdn that I sent at previous post
Also I did bing search and found there on internet hope they help.
http://www.c-sharpcorner.com/UploadFile/sthangaraju/ImageViewerinCSharp11262005063149AM/ImageViewerinCSharp.aspx
http://www.programminglearn.com/372/gdi-custom-controls-with-visual-c-2005-working-with-images#- Marqué comme réponseYichun_FengMSFT, Modérateurvendredi 13 novembre 2009 04:46
Toutes les réponses
- Hi,
Yes that's correct.
For example you can use
Image i=Image.FromFile(@"C:\sample.jpg");
and you can save Images just calling Save method. like i.Save
Here you can get more information from these links.
http://msdn.microsoft.com/en-us/library/system.drawing.image.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image_members.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image_methods.aspx
http://msdn.microsoft.com/en-us/library/system.drawing.image_properties.aspx- Marqué comme réponseYichun_FengMSFT, Modérateurvendredi 13 novembre 2009 04:46
- ok i got it i understood the idea but bieng a new learner of this i think i need the whole code for it
because am having errors such as :the name Image does not exist so am little confused here it's in the library or what ?
so plz i need the whole code - Image class is in System.Drawing namespace. If your project does not have the reference you should add the reference.
If you have the reference you should declare using System.Drawing at the top of your cs file or declare image as System.Drawing.Image in code.
There is no one code to use Image class in c# there are million of requirements, million of things you can do.
You can start with reading some documents, articles, papers to get the main idea. And when you have questions you can ask here too. But it's hard to write that million things in a single thread.
You can start reading the documentation on msdn that I sent at previous post
Also I did bing search and found there on internet hope they help.
http://www.c-sharpcorner.com/UploadFile/sthangaraju/ImageViewerinCSharp11262005063149AM/ImageViewerinCSharp.aspx
http://www.programminglearn.com/372/gdi-custom-controls-with-visual-c-2005-working-with-images#- Marqué comme réponseYichun_FengMSFT, Modérateurvendredi 13 novembre 2009 04:46

