Anonymous
in reply to:
Anonymous
03-21-2018
03:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-21-2018
03:13 AM
Solved with this code:
Public NotInheritable Class IPictureDispConverter : Inherits System.Windows.Forms.AxHost
Private Sub New()
MyBase.New("")
End Sub
Public Shared Function ImageToPictureDisp(image As Image) As IPictureDisp
Try
Return DirectCast(GetIPictureDispFromPicture(image), IPictureDisp)
Catch ex As Exception
'Add error message or logging here if desired.
'Handle the conversion error by simply returning Nothing.
Return Nothing
End Try
End Function
Public Shared Function PictureDispToImage(pictureDisp As IPictureDisp) As Image
Try
Return GetPictureFromIPicture(pictureDisp)
Catch ex As Exception
'Add error message or logging here if desired.
'Handle the conversion error by simply returning Nothing.
Return Nothing
End Try
End Function
End Class