/// /// Converts an Image to Icon - Supports Image Size upto 128x128/// /// Filename of the Image to convertprivate void Image2Icon(string fileName){ //Creats filename with ico extention string newFileName = Path.ChangeExtension(fileName, ".ico"); //Loading the File to the Bitmap using (Bitmap bitMap = Image.FromFile(fileName,true) as Bitmap) { using (Icon icon = Icon.FromHandle(bitMap.GetHicon())) { //Creating the Icon file and Writing the content using (Stream stream = File.Create(newFileName)) { icon.Save(stream); } } }}