Je voudrais créer un logiciel qui convertirait les images en icone mais je sais pas comment faire pour la conversion en icone!
Si vous avez des astuces, n'hésitez pas SVP.
Dim icoFile As String = "C:\Users\Gael\Desktop\output.ico" ' future emplacement
Dim img As Image = Image.FromFile("C:\Users\Gael\Desktop\test.png") ' emplacment du fichier d'origine
img.Save(icoFile, System.Drawing.Imaging.ImageFormat.Icon)
Dim icoFile As String = "C:\Users\Gael\Desktop\output.ico" ' future emplacement
Dim img As Image = Image.FromFile("C:\Users\Gael\Desktop\test.png") ' emplacment du fichier d'origine
Dim scale_factor As Single = 24 'entre ici la nouvelle taille
scale_factor = scale_factor / img.Width
Dim bm_source As New Bitmap(img)
Dim bm_dest As New Bitmap( _
CInt(bm_source.Width * scale_factor), _
CInt(bm_source.Height * scale_factor))
Dim gr_dest As Graphics = Graphics.FromImage(bm_dest)
gr_dest.DrawImage(bm_source, 0, 0, _
bm_dest.Width + 1, _
bm_dest.Height + 1)
img = bm_dest
img.Save(icoFile, System.Drawing.Imaging.ImageFormat.Icon)
Dim icoFile As String = "C:\Users\Gael\Desktop\output.ico" ' future emplacement
Dim img As Image = Image.FromFile("C:\Users\Gael\Desktop\test.png") ' emplacment du fichier d'origine
Dim scale_factor As Single = 48
dim widht = scale_factor / img.Width
dim height = scale_factor / img.heigth
Dim bm_source As New Bitmap(img)
Dim bm_dest As New Bitmap( _
CInt(bm_source.Width * widht), _
CInt(bm_source.Height * height))
Dim gr_dest As Graphics = Graphics.FromImage(bm_dest)
gr_dest.DrawImage(bm_source, 0, 0, _
bm_dest.Width + 1, _
bm_dest.Height + 1)
img = bm_dest
img.Save(icoFile, System.Drawing.Imaging.ImageFormat.Icon)