I need to create high quality icons for my current project in vb.net
This is my code so far,
Private Sub CreateIcon(ByVal bitmapName As String)
Try
Dim fi As New System.IO.FileInfo(bitmapName)
Dim bmp As New Bitmap(fi.FullName)
Dim sw As System.IO.StreamWriter = System.IO.File.CreateText(fi.FullName.Replace(fi.Extension, ".ico"))
Icon.FromHandle(bmp.GetHicon).Save(sw.BaseStream)
sw.Close()
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex)
End Try
End Sub
But the problem is it only gives me a very low quality icon at the end. Does anyone have any ideas for how to make a higher quality image?
I guess you should dig deeper into
icofile format and see how to construct it manually. If your task is tend to support only specific cases (source size and format), you may investigate this project: Dynamically Generating Icons (safely).The solvation has limitations, but it can be extended to match your requirements.