Anonymous
705 Views, 1 Reply
03-21-2018
01:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-21-2018
01:13 AM
Hello
the Thumbnail is in IPictureDisp format, and the picturebox requires an image.
How can it be converted?
The sugestion found on the fourms to use VB6 does not seem to work anymore. (removed because obsolete, and not compatible with 64 bit system)
In the addin template there is the image converter that converts from image to IPictureDisp but not the inverse.
Thank you!
Solved! Go to Solution.
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