realsync Posted March 11, 2004 Posted March 11, 2004 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. Quote
Moderators Robby Posted March 11, 2004 Moderators Posted March 11, 2004 You can't inherit System.Windows.Forms in an ASP.NET form. Quote Visit...Bassic Software
realsync Posted March 11, 2004 Author Posted March 11, 2004 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... Quote
Moderators Robby Posted March 11, 2004 Moderators Posted March 11, 2004 I don't understand what you mean by "VB image". Is it an embedded image in the exe or from file? Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.