Click here to Skip to main content
15,896,730 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I m tired of trying to convert an image of selected item in listview to use it as icon
into a dialog form.

How it's possible ?
Posted
Updated 16-Jul-11 8:17am
v3

This link[^] could help you out.
 
Share this answer
 
Comments
Salmen Essridi 16-Jul-11 14:16pm    
Thank you , i already know this solution is it the only one ? My 5 for your response :).
RaviRanjanKr 16-Jul-11 14:19pm    
Nice Link Abhinav.
Abhinav S 16-Jul-11 14:20pm    
Thanks Ravi.
Have a go there-[C# 2.0 Convert Bitmap to Icon][^] for getting solution having same question.

selected answer is :-

Bitmap bmp = new Bitmap(sourceFileName);
bmp.Save(@"C:\Test.ico",System.Drawing.Imaging.ImageFormat.Icon);
 
Share this answer
 
Comments
Abhinav S 16-Jul-11 14:20pm    
You solution is simpler. My 5.
Salmen Essridi 16-Jul-11 14:28pm    
good but i don't need to save the icon and also i mentioned that the image is from selected item in a listview and i want it to be drawed on the top of the form.
BrandonG157 20-Dec-11 9:22am    
When I use Bitmap = new Bitmap(Image);
My compiler says that an 'Object reference is not set to an instance of an object.'

I have been trying to convert a Picturebox to bitmap. Can you show me how to do it.

I think my problem is the picturebox does not load during the code execution but after the execution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900