Help in coverting image formats

Joined
Jun 25, 2007
Messages
2
Reaction score
0
I work in image processing program (Windows Application) and I have a problem in converting image from format to another.
The first problem
I converted the Image file to Icon through 2 ways but still have problems these 2 ways are:
1-
Bitmap icon =new Bitmap (ImagePath);
icon.Save(targetfilename, ImageFormat.Icon);
This way don't work correctly
2-
Bitmap bitmap = new Bitmap(ImagePath);
Icon ico = Icon.FromHandle(bitmap.GetHicon());
FileStream fs = new FileStream(targetfilename, FileMode.OpenOrCreate);
ico.Save(fs);
fs.Close();
This way make colors of the output icon change.
How can I convert this type?

The second problem:
When I convert to gif file as follow:
Bitmap bitmap = new Bitmap(ImagePath);
bitmap.Save(targetFileName, ImageFormat.Gif);
This way make low resolution, and if the source image doesnot have background, the output file will be with background in the converted formats (.Gif, .Bmp, .Jpeg)
How can I convert this type?


The third problem:
The formats Wmf, Exif, Emf donot have Encoder.
How can I convert them?

Please tell me wat is the wrong in my code
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top