Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: ERROR: Type 'ImageMagick.MagickImage' is not defined.

$
0
0
Good morning, I installed ImageMagick.Net with NuGet (Install-Package Magick.NET-Q8-x86) and it works correctly locally. However, when I compile and upload the files to the server, it gives the following error:
Compiler Error Message: BC30002: Type 'ImageMagick.MagickImage' is not defined.

Source Error:


Line 19:                 End If
Line 20: 
Line 21:                 Dim picture As New ImageMagick.MagickImage(Server.MapPath("~/mycube/img/") + uri)
Line 22:                 'Dim picture As New ImageMagick.MagickImage("C:\AppServ\www\hossman\" + uri)
Line 23: 
My code:
Public Class mycube
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try

            If Not Page.IsPostBack Then
                Dim uri As String = ""

                Try
                    uri = Request.QueryString("uri")
                Catch ex As Exception
                    uri = ""
                End Try

                If uri Is Nothing Then
                    Response.Write("")
                    Response.End()
                End If

                Dim picture As New ImageMagick.MagickImage(Server.MapPath("~/mycube/img/") + uri)

                Dim ancho As Integer = picture.Width()
                Dim alto As Integer = picture.Height()

                picture.BackgroundColor = ImageMagick.MagickColor.Transparent
                picture.MatteColor = ImageMagick.MagickColor.Transparent
                picture.VirtualPixelMethod = ImageMagick.VirtualPixelMethod.Transparent

                picture.Distort(ImageMagick.DistortMethod.Perspective, New Double() {0, 0, 2, 2, ancho, 0, 192, 1, ancho, alto, 193, 242, 0, alto, 2, 230})

                Dim fondo As New ImageMagick.MagickImage(Server.MapPath("~/mycube/img/") + "3dcubof.png")

                fondo.Composite(picture, 20, 16, ImageMagick.CompositeOperator.Over)
                fondo.BackgroundColor = ImageMagick.MagickColor.Transparent

                Dim buffer As New System.IO.MemoryStream
                fondo.ToBitmap().Save(buffer, System.Drawing.Imaging.ImageFormat.Png)
                Dim output = buffer.GetBuffer()
                Response.Clear()
                Response.ContentType = "image/png"
                Response.BinaryWrite(output)
                System.IO.File.Delete(Server.MapPath("~/mycube/img/") + uri)
                Response.End()
            End If
        Catch ex As Exception
            Response.Write(ex.Message)
        End Try
    End Sub

End Class
I do not know how to fix it ... I have checked that the dll is correctly generated in the bin folder, and as I said, on my local computer works correctly, only server failure (both locally and on the server I have. Net Framework 4.0).

Thank you very much for your help.

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>