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

BitmaptoIcon

Convert from bitmap to icon - use resource bitmaps for form icons

Source

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

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

End Function

Example

Me.Icon = My.Resources.timer_16_h.toIcon

Author: Polychrome

Submitted on: 10 apr 2014

Language: VB

Type: icon

Views: 2480