Код: Выделить всё
private void btnCnvrtSave_Click(object sender, EventArgs e)
{
Bitmap bmp = new Bitmap(sourceFile); //sourceFile = openfiledialog.FileName;
IntPtr Hicon = bmp.GetHicon();
Icon myIcon = Icon.FromHandle(Hicon);
SaveFileDialog sfd = new SaveFileDialog();
sfd.Title = "Save Icon";
sfd.Filter = "Icon|*.ico";
sfd.ShowDialog();
FileStream fileStream = new FileStream(sfd.FileName, FileMode.OpenOrCreate);
myIcon.Save(fileStream);
fileStream.Flush();
fileStream.Close();
MessageBox.Show("Image is converted successfully!");
//Process.Start(sfd.FileName);
}
Пожалуйста, скажите мне, в чем проблема.
Подробнее здесь: https://stackoverflow.com/questions/817 ... ap-to-icon
Мобильная версия