using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO;   namespace ImageToIcon {   public partial class ImageToIcon
: Form   {     Stream myStream;     public ImageToIcon()     {      
InitializeComponent();     }   // 파일을 열어서 // 썸네일 추출     private void
btnOpenImage_Click(object sender, EventArgs e)     {         if (ofdPicture.ShowDialog() == DialogResult.OK)       {         if ((myStream = ofdPicture.OpenFile()) != null)         {           Image
image = Image.FromFile(ofdPicture.FileName);           Image
newImage = image.GetThumbnailImage(32, 32, null,
new IntPtr());          
txtImagePath.Text = ofdPicture.FileName;          
pbImage.Image = newImage;         }       }     }   // 썸네일을 아이콘으로 저장     private void
btnSaveAsIcon_Click(object sender, EventArgs e)     {       if (sfdPicture.ShowDialog() == DialogResult.OK)       {         String fileName = sfdPicture.FileName;         Stream IconStream = System.IO.File.OpenWrite(fileName);           Bitmap
bitmap = new Bitmap(pbImage.Image);        
bitmap.SetResolution(72, 72);         Icon icon =
System.Drawing.Icon.FromHandle(bitmap.GetHicon());         this.Icon = icon;        
icon.Save(IconStream);       }     }   } }   출처: http://code.msdn.microsoft.com/windowsdesktop/Convert-Image-file-to-Icon-c927d9f7 
- [2016/09/24] XML 으로 환경설정 저장하기 ( \n,엔터값 포함, NewLine) (10537)
- [2013/08/29] int array to string (11203)
- [2013/08/29] byte array to Hexa String (13381)
- [2013/03/17] C#, 16진수 TEXT => 10 진수 변환 (24456)
- [2013/01/06] byte array to string (14694)
- [2013/01/06] string to byte array (14059)
- [2010/10/10] 프로그램을 트레이 아이콘으로 보내기, tray (31051)
- [2010/09/05] EXE 파일 아이콘 읽어서 ListView에 출력하기 (25250)

 
	
		 


 
    
 
    
