How to create high quality icons in VB.net

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 that it only gives me very low quality in the end. Does anyone have any ideas on how to make a higher quality image?

+3
source share
1 answer

I think you should delve into the file format icoand see how to build it manually. If your task, as a rule, supports only specific cases (size and format of the source), you can study this project: Dynamically creating icons (safe) .

Solvation has limitations, but you can expand it to fit your needs.

0

All Articles