Loading...

Using AxImaging and AxViewer objects on different forms

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

Using AxImaging and AxViewer objects on different forms

Postby mreynold » Tue Sep 09, 2008 1:24 am

I have the AxImaging object on my main form, but the AxViewer object I put on a sub-form, in order to speed up the scanning. The Form_Load handler does not run instantly, it runs only after a delay, which can be substantial on very slow machines. So I call the following code from a thread spawned from the main form in order to avoid this delay:

Code: Select all
        While AxImaging1.CreateImageFromTwain <> 0
            nPageCount += 1
            AxImaging1.ConvertTo8BppQ()
            nAcquiredImage = AxImaging1.GetNativeImage
            If nPageCount = 1 Then
                m_nTiffMultipage = AxImaging1.TiffCreateMultiPageFromGdPictureImage(nAcquiredImage)
                m_dlgViewer.m_nTiffMultipage = m_nTiffMultipage
            Else
                AxImaging1.TiffAppendPageFromGdPictureImage(m_nTiffMultipage, nAcquiredImage)
            End If
            m_dlgViewer.AxGdViewer1.SetNativeImage(m_nTiffMultipage)
            m_dlgViewer.AxGdViewer1.DisplayLastFrame()
            AxImaging1.CloseImage(nAcquiredImage)
        End While

This was previously working, but with the latest revision any call to m_dlgViewer.AxGdViewer1 bombs with the error, "Invalid image: Can not get picture height." Is there a problem with getting these two objects to communicate across different forms?
mreynold
 

Re: Using AxImaging and AxViewer objects on different forms

Postby Loïc » Tue Sep 09, 2008 5:13 pm

Hi,

I can't reproduce this problem.

Could you send me a tiny application which shows this error ?

Also, check you are using the same GdPicture library for your Imaging & GdViewer objects.

Best regards,

Loïc Carrère
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4442
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Using AxImaging and AxViewer objects on different forms

Postby mreynold » Wed Sep 10, 2008 4:29 am

You are correct, there was some kind of error in the Visual Studio project. When I pulled the GdPicture references and form objects and reinserted them, everything started working as normal again.

Thank you!
mreynold
 


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest