Pilz.UI: convert to C#
This commit is contained in:
14
Pilz.UI/Extensions.vb
Normal file
14
Pilz.UI/Extensions.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Imports System.Drawing
|
||||
Imports System.Runtime.CompilerServices
|
||||
|
||||
Public Module Extensions
|
||||
|
||||
<Extension>
|
||||
Public Function ToIcon(image As Image)
|
||||
If TypeOf image Is Bitmap Then
|
||||
Return Icon.FromHandle(CType(image, Bitmap).GetHicon)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user