ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

ImageToIcon

Converte imagem do resources em icone

Source

<Extension()> _
Public Function toIcon(ByVal IconFromResources As Image) As Icon

    Dim myIcon As Bitmap = IconFromResources
    Return Icon.FromHandle(myIcon.GetHicon)

End Function

Example

My.resourses.MyImage.ToIcon()

Author: Alex Martins

Submitted on: 23 aug. 2017

Language: VB

Type: Image

Views: 3356