Image to Icon Converter

inkedGFX

Well-known member
Joined
Feb 2, 2013
Messages
142
Programming Experience
Beginner
I am working on a program to convert any image to a .ico icon file.....my code works to convert the image to an ico file but it is very low res....anyone know how to save the ico at a higher resolution?

code to save ico file

     private void cmdSave_Click(object sender, EventArgs e)
        {
            SaveFileDialog SFD = new SaveFileDialog();
            SFD.Filter = "Icon Files (*.ico)|*.ico";
            if (SFD.ShowDialog() == DialogResult.OK)
            {
                String FileName = SFD.FileName;
                Stream IconStream = File.OpenWrite(FileName);
                Bitmap bitmap128 = new Bitmap(pictureBox2.Image);
                bitmap128.SetResolution(72, 72);
                Icon icon128 = Icon.FromHandle(bitmap128.GetHicon());
                icon128.Save(IconStream);
                IconStream.Close();

                //Bitmap bitmap64 = new Bitmap(pictureBox3.Image);
                //bitmap64.SetResolution(64, 64);
                //Icon icon64 = Icon.FromHandle(bitmap64.GetHicon());
                //icon64.Save(IconStream);
                MessageBox.Show("SUCCESS, Icon Saved!!!", "Icon Saved Successfully");
            }
        }


thank you for any help!

InkedGFX
 
Back
Top Bottom