<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert IPictureDisp To System.Drawing.Image in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/13004329#M134361</link>
    <description>&lt;DIV&gt;Imports System.Windows.Forms&lt;/DIV&gt;&lt;DIV&gt;Imports System.Drawing&lt;/DIV&gt;&lt;DIV&gt;AddReference "System.Drawing"&lt;/DIV&gt;&lt;DIV&gt;AddReference "stdole"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Sub Main&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Get the active document (must be a PartDocument)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; If oPartDoc.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox("Please open a part document.")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exit Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Get the thumbnail from iProperties&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; Dim oThumbnail As stdole.IPictureDisp = oPartDoc.PropertySets.Item("Inventor Summary Information").Item("Thumbnail").Value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Convert the IPictureDisp to a .NET Bitmap object using the converter class&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oPicture As System.Drawing.Image = IPictureDispConverter.PictureDispToImage(oThumbnail)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; If oPicture IsNot Nothing Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' Use the oPicture object, for example:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MsgBox("Thumbnail converted successfully!")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;oPicture.Save("C:\TEMP\Thumbnail.jpg")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Else&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox("Failed to convert thumbnail.")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;' Custom class that exposes the GetPictureFromIPictureDisp method from AxHost&lt;/DIV&gt;&lt;DIV&gt;Public NotInheritable Class IPictureDispConverter : Inherits AxHost&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Private Sub New()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyBase.New("")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Function to convert IPictureDisp to Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Public Shared Function PictureDispToImage(oThumbnail As stdole.IPictureDisp) As Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' Use the protected method from AxHost to convert IPictureDisp to Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return GetPictureFromIPictureDisp(oThumbnail)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch ex As Exception&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myparam = InputBox("Error converting: ", "Conversion Error", ex.Message)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return Nothing&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End Function&lt;/DIV&gt;&lt;DIV&gt;End Class&lt;/DIV&gt;</description>
    <pubDate>Fri, 06 Sep 2024 07:10:30 GMT</pubDate>
    <dc:creator>ejaL9K8H</dc:creator>
    <dc:date>2024-09-06T07:10:30Z</dc:date>
    <item>
      <title>Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3626400#M134346</link>
      <description>&lt;P&gt;Hi alll,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some annoying warning :&amp;nbsp;'Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only. To repair this, I search on this forum and I&amp;nbsp; found this link:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://modthemachine.typepad.com/my_weblog/2012/02/bitmaps-without-vb6-icontoipicture.html"&gt;http://modthemachine.typepad.com/my_weblog/2012/02/bitmaps-without-vb6-icontoipicture.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I fix 50% of my warning qith this class... but I want to display the thumbnail of my part on a form and this class do only ImageToIPictureDisp and not IPictureDispToImage.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyone have an idea to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Israel Marin&lt;/P&gt;&lt;P&gt;Sherbrooke,Qc&lt;/P&gt;</description>
      <pubDate>Wed, 19 Sep 2012 20:11:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3626400#M134346</guid>
      <dc:creator>marin_israel</dc:creator>
      <dc:date>2012-09-19T20:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3627044#M134347</link>
      <description>&lt;P&gt;Is this of any help?&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://blogs.msdn.com/b/andreww/archive/2007/07/30/converting-between-ipicturedisp-and-system-drawing-image.aspx"&gt;http://blogs.msdn.com/b/andreww/archive/2007/07/30/converting-between-ipicturedisp-and-system-drawing-image.aspx&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2012 10:28:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3627044#M134347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-20T10:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3627058#M134348</link>
      <description>&lt;P&gt;This type of conversions are suitable to implement as Extension methods:&lt;/P&gt;&lt;PRE&gt;public static stdole.IPictureDisp ImageToPictureDisp(this Image image)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2012 10:39:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3627058#M134348</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-09-20T10:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3630774#M134349</link>
      <description>&lt;P&gt;on the basis of the comment of&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A id="link_139f6f0cb85" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/87076" target="_self"&gt;JohanLarsson&lt;/A&gt;, I'd like to suggest you take a look at the blog below. It contains more codes.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;&lt;A href="http://modthemachine.typepad.com/my_weblog/2010/06/accessing-thumbnail-images.html" target="_blank"&gt;http://modthemachine.typepad.com/my_weblog/2010/06/accessing-thumbnail-images.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2012 06:23:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3630774#M134349</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2012-09-24T06:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3633154#M134350</link>
      <description>&lt;P&gt;Hi guys, thanks for your replies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I checked your link, but I'm able to do this operation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is only to stop having the warning :&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;"Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Ths link I posted before on this topic is the answer but just for&amp;nbsp;"ImageToIPictureDisp" but I have to do the inverse.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks again!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Israel Marin&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Sherbrooke, Qc, CAN&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Sep 2012 16:04:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3633154#M134350</guid>
      <dc:creator>marin_israel</dc:creator>
      <dc:date>2012-09-25T16:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3653398#M134351</link>
      <description>&lt;P&gt;&lt;SPAN&gt;for the warining "&lt;SPAN&gt;Microsoft.VisualBasic.Compatibility.* classes are obsolete and supported within 32 bit processes only", t&lt;/SPAN&gt;he MSDN link &lt;A href="http://go.microsoft.com/fwlink/?linkid=160862'" target="_blank"&gt;http://go.microsoft.com/fwlink/?linkid=160862'&lt;/A&gt;&amp;nbsp;provides several solutions, you can fix this problem using anyone of them. (I copied them below for your convenience) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Actually the warning message only appears if the target version of the .NET framework is set to 4. So you must be using&amp;nbsp;4.0. Inventor 2012 is designed to use.net 3.5. I&amp;nbsp;would suggest you to&amp;nbsp;use .net 3.5 too if you are using Inventor 2012.&amp;nbsp;Thus that warning will be gone and the old code works without problem.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As to the second solution, we also have a sample code for achieving conversion from Icon to IPictureDisp, this should work under .Net 4.0. The sample is enclosed in the bottom of this post. So you can use it to replace the Microsoft.VisualBasic.Compatibility.dll.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As to the third solution. It says you can just ignore that warning if you use VS2010 as that warning has no impact on your application, its title says "supported within 32 bit processes only"&amp;nbsp;though.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Personally, I would suggest using the first solution.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;Public NotInheritable Class PictureDispConverter
        &amp;lt;DllImport("OleAut32.dll", EntryPoint:="OleCreatePictureIndirect", ExactSpelling:=True, PreserveSig:=False)&amp;gt; _
        Private Shared Function OleCreatePictureIndirect( _
            &amp;lt;MarshalAs(UnmanagedType.AsAny)&amp;gt; ByVal picdesc As Object, _
            ByRef iid As Guid, _
            &amp;lt;MarshalAs(UnmanagedType.Bool)&amp;gt; ByVal fOwn As Boolean) As stdole.IPictureDisp
        End Function

        Shared iPictureDispGuid As Guid = GetType(stdole.IPictureDisp).GUID

        Private NotInheritable Class PICTDESC
            Private Sub New()
            End Sub

            'Picture Types
            Public Const PICTYPE_UNINITIALIZED As Short = -1
            Public Const PICTYPE_NONE As Short = 0
            Public Const PICTYPE_BITMAP As Short = 1
            Public Const PICTYPE_METAFILE As Short = 2
            Public Const PICTYPE_ICON As Short = 3
            Public Const PICTYPE_ENHMETAFILE As Short = 4

            &amp;lt;StructLayout(LayoutKind.Sequential)&amp;gt; _
            Public Class Icon
                Friend cbSizeOfStruct As Integer = Marshal.SizeOf(GetType(PICTDESC.Icon))
                Friend picType As Integer = PICTDESC.PICTYPE_ICON
                Friend hicon As IntPtr = IntPtr.Zero
                Friend unused1 As Integer
                Friend unused2 As Integer

                Friend Sub New(ByVal icon As System.Drawing.Icon)
                    Me.hicon = icon.ToBitmap().GetHicon()
                End Sub
            End Class

            &amp;lt;StructLayout(LayoutKind.Sequential)&amp;gt; _
            Public Class Bitmap
                Friend cbSizeOfStruct As Integer = Marshal.SizeOf(GetType(PICTDESC.Bitmap))
                Friend picType As Integer = PICTDESC.PICTYPE_BITMAP
                Friend hbitmap As IntPtr = IntPtr.Zero
                Friend hpal As IntPtr = IntPtr.Zero
                Friend unused As Integer

                Friend Sub New(ByVal bitmap As System.Drawing.Bitmap)
                    Me.hbitmap = bitmap.GetHbitmap()
                End Sub
            End Class
        End Class

        Public Shared Function ToIPictureDisp(ByVal icon As System.Drawing.Icon) As stdole.IPictureDisp
            Dim pictIcon As New PICTDESC.Icon(icon)
            Return OleCreatePictureIndirect(pictIcon, iPictureDispGuid, True)
        End Function

        Public Shared Function ToIPictureDisp(ByVal bmp As System.Drawing.Bitmap) As stdole.IPictureDisp
            Dim pictBmp As New PICTDESC.Bitmap(bmp)
            Return OleCreatePictureIndirect(pictBmp, iPictureDispGuid, True)
        End Function
    End Class
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2012 09:54:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3653398#M134351</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2012-10-10T09:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3653570#M134352</link>
      <description>&lt;P&gt;Thanks for the 3 ways to fix the warning...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1-I use Inventor 2013, who supported only framework4.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2-As I say in previous post, I use this sample code but it's a one way converter. I can convert BMP to IPicture, but no, IPicture to BMP... because I want to show preview of ASM in a thumbnail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3-I know I can ignore the warning but it's annoying. I have about 50 warnings...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2012 12:36:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3653570#M134352</guid>
      <dc:creator>marin_israel</dc:creator>
      <dc:date>2012-10-10T12:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3661000#M134353</link>
      <description>&lt;P&gt;about converting IPicture to Bitmap, probably this link is helpful to you:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/b/andreww/archive/2007/07/30/converting-between-ipicturedisp-and-system-drawing-image.aspx" target="_blank"&gt;http://blogs.msdn.com/b/andreww/archive/2007/07/30/converting-between-ipicturedisp-and-system-drawing-image.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to use the ability directly without implementing yourself, you could use the&amp;nbsp;InventorViewControlLib Inventor provides. The SDK sample is a demo.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; SDK\DeveloperTools\Samples\VCSharp.NET\Standalone Applications\ApprenticeServer\FileDisplay&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 10:05:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3661000#M134353</guid>
      <dc:creator>xiaodong_liang</dc:creator>
      <dc:date>2012-10-16T10:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3661162#M134354</link>
      <description>&lt;P&gt;Thanks you Xiaodong!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This link resolved my problem. With the AxHost, I can converted the Ipicture to Image!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Israel Marin&lt;/P&gt;&lt;P&gt;Sherbrooke, Qc,CA&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2012 12:10:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/3661162#M134354</guid>
      <dc:creator>marin_israel</dc:creator>
      <dc:date>2012-10-16T12:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5794501#M134355</link>
      <description>&lt;P&gt;For those who are unfamiliar or do not program in C# here is the VB&amp;nbsp;interpretation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Imports&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; System.Windows.Forms&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Imports&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; System.Drawing&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Imports&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; Inventor&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; This class performs the following conversion:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; • Image to iPictureDisplay&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; • iPictureDisplay to Image&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;remarks&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; You must Import the following namespaces.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; • System.Drawing&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; • System.Windows.Forms&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; Note:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; If you are using WPF then you will need to add a reference to the "System.Windows.Forms" framework to your project.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/remarks&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;NotInheritable&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;IPictureDispConverter&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; : &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Inherits&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;AxHost&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; This method is required to impliment the AxHost.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; You do not need to modify this sub.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;()&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyBase&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; Converts a standard image to an IPictureDisp object.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;param name="&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;image&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;"&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;[Image] Image to convert to IPictureDisp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/param&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;returns&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;[IPictureDisp] or Nothing on exception.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/returns&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Shared&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; ImageToPictureDisp(image &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Image&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;) &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; IPictureDisp&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;DirectCast&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;(GetIPictureDispFromPicture(image), IPictureDisp)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; ex &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Exception&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'Add error message or logging here if desired.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'Handle the conversion error by simply returning Nothing.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Nothing&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Try&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt; Converts an IPictureDisp object to a standard image file.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/summary&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;param name="&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;pictureDisp&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;"&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;[IPictureDisp] IPictureDisp object to convert to image.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/param&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'''&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;returns&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;[Image] or Nothing on exception.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&lt;FONT color="#808080" face="Consolas" size="2"&gt;&amp;lt;/returns&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Shared&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; PictureDispToImage(pictureDisp &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; IPictureDisp) &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Image&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; GetPictureFromIPicture(pictureDisp)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt; ex &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Exception&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'Add error message or logging here if desired.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#008000" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;'Handle the conversion error by simply returning Nothing.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Nothing&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Try&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;&lt;FONT face="Consolas" size="2"&gt;Below is a Visual Studio Item Template of the code.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 18:38:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5794501#M134355</guid>
      <dc:creator>Boorda</dc:creator>
      <dc:date>2015-08-29T18:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5990069#M134356</link>
      <description>&lt;P&gt;So is it possible to easily use this code to make an exe I can use to export thumbnails as images (like bmp or jpg) so i can use them?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I currently have a 64 bit computer, so I'm pretty sure I can't use it directly.... Then again, all the documentation about this conversion is all over the place for someone who is only a hobbyist programmer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried importing it into visual studio express as a module and added the inventor reference, but I still have like 6 errors - no reference to axhost or image, mostly.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 01:35:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5990069#M134356</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2016-01-15T01:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5992947#M134357</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;The code above will work fine in 64 bit applications. I do it on 64 bit machines using&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;WPF&lt;/SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;You'll need to create the code as a Class instead of a Module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;You can't inherit the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;AxHost&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in a module.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;Inherit simply means you are&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;merging&amp;nbsp;all of an inheritable classes’&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;methods and properties into the current class.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;The&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="font-family: 'Verdana',sans-serif;"&gt;"Public&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;I&gt;&amp;nbsp;&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;I&gt;NotInheritable&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;I&gt;&amp;nbsp;&lt;/I&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="font-family: 'Verdana',sans-serif;"&gt;Class&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;I&gt;&amp;nbsp;&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;I&gt;IPictureDispConverter&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;I&gt;&amp;nbsp;&lt;/I&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="font-family: 'Verdana',sans-serif;"&gt;: Inherits&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&lt;I&gt;&amp;nbsp;&lt;/I&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;I&gt;AxHost&lt;/I&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="font-family: 'Verdana',sans-serif;"&gt;"&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;line states that the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;IPictureDispConverter&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;class inherits from the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;STRONG&gt;AxHost&lt;/STRONG&gt;&lt;/SPAN&gt;&amp;nbsp;class which is in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN style="font-family: 'Verdana',sans-serif;"&gt;System.Windows.Forms&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;namespace&lt;/SPAN&gt;. &amp;nbsp;If you are creating a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;WPF&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;application then you will need to add a reference to the System.Windows.Forms&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;namespace&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;in your project.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; font-family: 'Verdana',sans-serif; color: black;"&gt;Also the code should work fine in a 64 bit&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;environment, but if not then it may be due to how your Configuration Manager is set up in your Visual Studio project; I usually target &amp;lt;Any CPU&amp;gt;. If you are still having issues after converting to a Class and adding the reference then I will explain in further detail.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 19:06:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5992947#M134357</guid>
      <dc:creator>Boorda</dc:creator>
      <dc:date>2016-01-17T19:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5992954#M134358</link>
      <description>Also make sure you added a reference to the System.Windows.Drawing namespace in your project. that is where the Image object lives.</description>
      <pubDate>Sun, 17 Jan 2016 19:15:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5992954#M134358</guid>
      <dc:creator>Boorda</dc:creator>
      <dc:date>2016-01-17T19:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5992970#M134359</link>
      <description>&lt;P&gt;This is an old problem. IPictureDisp can't do marshall to other exe application.&lt;/P&gt;&lt;P&gt;You should create macro&lt;/P&gt;&lt;P&gt;&lt;A href="http://modthemachine.typepad.com/my_weblog/2010/06/accessing-thumbnail-images.html" target="_blank"&gt;http://modthemachine.typepad.com/my_weblog/2010/06/accessing-thumbnail-images.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;and run the macro from your exe&amp;nbsp;&lt;SPAN&gt;application.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But much better use AddIn. The AddIn have not problem with IPictureDisp.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 19:48:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/5992970#M134359</guid>
      <dc:creator>mikazakov</dc:creator>
      <dc:date>2016-01-17T19:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/13004307#M134360</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;I made this iLogic rule to get the thumbnail and save it as a jpg file:&lt;BR /&gt;I am trying to convert the Thumbnail from a iPictureDisp to a Image object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;BR /&gt;But i get this error mesage:&amp;nbsp;Unknown name. (Exception from HRESULT: 0x80020006 (DISP_E_UNKNOWNNAME))&lt;BR /&gt;Can somebody help me out?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;Imports System.Windows.Forms&lt;/DIV&gt;&lt;DIV&gt;Imports System.Drawing&lt;/DIV&gt;&lt;DIV&gt;AddReference "System.Drawing"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Sub Main&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Get the active document (must be a PartDocument)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; If oPartDoc.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox("Please open a part document.")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exit Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Get the thumbnail from iProperties&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oThumbnail As Object = oPartDoc.PropertySets.Item("Inventor Summary Information").Item("Thumbnail").Value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Convert the IPictureDisp to a .NET Bitmap object using the converter class&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oPicture As System.Drawing.Image = IPictureDispConverter.PictureDispToImage(oThumbnail)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; If oPicture IsNot Nothing Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' Use the oPicture object, for example:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MsgBox("Thumbnail converted successfully!")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;oPicture.Save("C:\TEMP\Thumbnail.jpg")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Else&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox("Failed to convert thumbnail.")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;' Custom class that exposes the GetPictureFromIPictureDisp method from AxHost&lt;/DIV&gt;&lt;DIV&gt;Public NotInheritable Class IPictureDispConverter : Inherits AxHost&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Private Sub New()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyBase.New("")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Function to convert IPictureDisp to Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Public Shared Function PictureDispToImage(oThumbnail As Object) As Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' Use the protected method from AxHost to convert IPictureDisp to Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return GetPictureFromIPictureDisp(oThumbnail)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch ex As Exception&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myparam = InputBox("Error converting: ", "Conversion Error", ex.Message)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return Nothing&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End Function&lt;/DIV&gt;&lt;DIV&gt;End Class&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Sep 2024 06:53:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/13004307#M134360</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2024-09-06T06:53:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert IPictureDisp To System.Drawing.Image</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/13004329#M134361</link>
      <description>&lt;DIV&gt;Imports System.Windows.Forms&lt;/DIV&gt;&lt;DIV&gt;Imports System.Drawing&lt;/DIV&gt;&lt;DIV&gt;AddReference "System.Drawing"&lt;/DIV&gt;&lt;DIV&gt;AddReference "stdole"&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Sub Main&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Get the active document (must be a PartDocument)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; If oPartDoc.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kPartDocumentObject Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox("Please open a part document.")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Exit Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Get the thumbnail from iProperties&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; Dim oThumbnail As stdole.IPictureDisp = oPartDoc.PropertySets.Item("Inventor Summary Information").Item("Thumbnail").Value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Convert the IPictureDisp to a .NET Bitmap object using the converter class&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Dim oPicture As System.Drawing.Image = IPictureDispConverter.PictureDispToImage(oThumbnail)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; If oPicture IsNot Nothing Then&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' Use the oPicture object, for example:&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MsgBox("Thumbnail converted successfully!")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;oPicture.Save("C:\TEMP\Thumbnail.jpg")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Else&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MsgBox("Failed to convert thumbnail.")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End If&lt;/DIV&gt;&lt;DIV&gt;End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;' Custom class that exposes the GetPictureFromIPictureDisp method from AxHost&lt;/DIV&gt;&lt;DIV&gt;Public NotInheritable Class IPictureDispConverter : Inherits AxHost&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Private Sub New()&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyBase.New("")&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End Sub&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; ' Function to convert IPictureDisp to Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; Public Shared Function PictureDispToImage(oThumbnail As stdole.IPictureDisp) As Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ' Use the protected method from AxHost to convert IPictureDisp to Image&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return GetPictureFromIPictureDisp(oThumbnail)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Catch ex As Exception&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myparam = InputBox("Error converting: ", "Conversion Error", ex.Message)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Return Nothing&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Try&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; End Function&lt;/DIV&gt;&lt;DIV&gt;End Class&lt;/DIV&gt;</description>
      <pubDate>Fri, 06 Sep 2024 07:10:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/convert-ipicturedisp-to-system-drawing-image/m-p/13004329#M134361</guid>
      <dc:creator>ejaL9K8H</dc:creator>
      <dc:date>2024-09-06T07:10:30Z</dc:date>
    </item>
  </channel>
</rss>

