This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
danimaribeiro  
#1 Posted : Tuesday, December 15, 2009 4:47:00 AM(UTC)
danimaribeiro

Rank: Newbie

Groups: Guest
Joined: 12/15/2009(UTC)
Posts: 2

I'm getting an error System.AccessViolationException to convert an object Drawing.Bitmap to Aurigma.GraphicsMill.Bitmap.

This is my code:
Code:

    Private Function ObterImagemAmpliadaParaPreviewDoTemplate() As Aurigma.GraphicsMill.Bitmap
        Dim imagemParaPreviewDoTemplate As Aurigma.GraphicsMill.Bitmap = Nothing
        Try
            imagemParaPreviewDoTemplate = Me.ObterImagemParaPreviewDoTemplate()

            Dim novoTamanhoDaImagem As Size = Me.CalcularTamanhoDaImagem.RetornaNovoTamanhoImagem(New Size(imagemParaPreviewDoTemplate.Width, imagemParaPreviewDoTemplate.Height), Me.FotoProdutoConfig.TamanhoMaxImagemAmpliadaTemplate)
            imagemParaPreviewDoTemplate.Transforms.Resize(novoTamanhoDaImagem, Aurigma.GraphicsMill.Transforms.ResizeMode.Fit, Aurigma.GraphicsMill.Transforms.InterpolationMode.HighQuality)
        Catch ex As Exception
            Throw New Exception("Falha ao obter imagem ampliada para preview do template.", ex)
        End Try
        Return imagemParaPreviewDoTemplate
    End Function



Stack Trace:
Code:

System.AccessViolationException : Tentativa de leitura ou gravação em memória protegida. Normalmente, isso é uma indicação de que outra memória está danificada.
   em memcpy(Void* , Void* , UInt32 )
   em Aurigma.GraphicsMill.Bitmap._Create(Bitmap bitmap)
   em Aurigma.GraphicsMill.Bitmap..ctor(Bitmap bitmap)
   em Aurigma.GraphicsMill.Bitmap.op_Implicit(Bitmap bitmap)
   em FotoProduto.ServidorTemplate.ImagensBmpDoPreviewDoTemplate.ObterImagemParaPreviewDoTemplate()


I think the error is in converting the object implicitly, in return of function.

Thank you for your help
Tamila  
#2 Posted : Wednesday, December 16, 2009 2:14:39 AM(UTC)
Tamila

Rank: Advanced Member

Groups: Guest
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hi,

I tried to reproduce your problem locally but everything worked well.
Anyway, it is a very important problem, could you please submit the case and send us test application which allows to reproduce the problem. Also if this issue is reproduced on particular image, send me it too.
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
danimaribeiro  
#3 Posted : Wednesday, December 16, 2009 3:11:44 AM(UTC)
danimaribeiro

Rank: Newbie

Groups: Guest
Joined: 12/15/2009(UTC)
Posts: 2

I get the error a few times.
But, I solved the problem.

code error:
Code:

    Private Function ObterImagemParaPreviewDoTemplate() As Aurigma.GraphicsMill.Bitmap
        Dim imagemParaPreviewDoTemplateBmp As System.Drawing.Bitmap = Me.VisualizadorMultiCamadas.RenderWorkspace.ToGdiplusBitmapDirectly()
        Dim imagemParaPreviewDoTemplate As Aurigma.GraphicsMill.Bitmap = imagemParaPreviewDoTemplateBmp
        Return imagemParaPreviewDoTemplate
    End Function


Code Correct:
Code:

    Private Function ObterImagemParaPreviewDoTemplate() As Aurigma.GraphicsMill.Bitmap
        Dim imagemParaPreviewDoTemplateBmp As System.Drawing.Bitmap = Me.VisualizadorMultiCamadas.RenderWorkspace.ToGdiplusBitmapDirectly()
        Dim imagemParaPreviewDoTemplate As New Aurigma.GraphicsMill.Bitmap(imagemParaPreviewDoTemplateBmp) //Instantiated
        Return imagemParaPreviewDoTemplate
    End Function


As I told the error sometimes occurs, and any jpg image.
Until now there was an error.
I really not understand why the error occured. I don't know difference between the lines modified, it is do the same thing.
Tamila  
#4 Posted : Thursday, December 17, 2009 1:32:15 AM(UTC)
Tamila

Rank: Advanced Member

Groups: Guest
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hi,

Unfortunately we cannot reproduce your problem locally. Could you please send me sample project where the problem appears.
Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.