Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi everybody,

 

I am currently trying to evelop a dll which should convert an old VB Images to a VB.NET Picture (both from the Imagebox object). This, I have learned, can be done through the 'System.Windows.Forms.AxHost'.

 

So, i have created a dll. The code is as follows:

 

Public Class ConvertImage

Inherits System.Windows.Forms.AxHost

Public Sub New()

MyBase.New("59EE46BA-677D-4d20-BF10-8D8067CB8B33")

End Sub

 

Public Shared Function ImageToIPicture(ByVal Image As System.Drawing.Image) As stdole.IPictureDisp

ImageToIPicture = GetIPictureFromPicture(Image)

End Function

 

Public Shared Function IPictureToImage(ByVal Image As stdole.IPictureDisp) As System.Drawing.Image

IPictureToImage = GetPictureFromIPicture(Image)

End Function

End Class

 

I have tried including the dll in other projects, and it works just fine. However, when trying to make this work in asp.net I get an error:

 

Compiler Error Message: BC30007: Reference required to assembly 'System.Windows.Forms' containing the base class 'System.Windows.Forms.AxHost'. Add one to your project.

 

 

Now, my development machine is not the same as the webserver; could it be that I need to copy some support-files or anything? My previous work seems to run just fine, so I'm not sure what can be wrong.

Posted

Ok, thanks for the quick reply!

 

Hmm... do you know if there is any other way of converting a VB Image to a VB.NET Picture? I've been looking al over the net for this, but can't seem to find a way...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...