Loading...

Displaying multiple pages of a .TIFF image

Support for GdViewer OCX and GdViewer Pro ActiveX/SDK.

Displaying multiple pages of a .TIFF image

Postby Andy Trezise » Mon Nov 19, 2007 2:20 pm

I am using the code below to view multiple pages from a .TIFF file side by side in two panels. The code works OK but can be a little slow as I'm having to load the image twice - I'd like to create a 6-panel view but this would seriously slow down the initial view and subsequent refresh when the user moves forwards and backwards.

Is there a better (more efficient) way of achieving the same results?



Code: Select all
cWork = "c:\myfile.tif"

ThisForm.oGdViewer1.DisplayFromFile(cWork)

ThisForm.nTotalPages = oPage.oGdViewer1.NumPages

IF ThisForm.nTotalPages > 0
    oPage.oGdViewer1.DisplayFrame(1)
ENDIF

IF ThisForm.nTotalPages > 1
    ThisForm.oGdViewer1.DisplayFromFile(cWork)
    oPage.oGdViewer2.DisplayFrame(2)
ENDIF
Andy Trezise
 
Posts: 10
Joined: Wed Nov 07, 2007 1:39 am

Postby Loïc » Mon Nov 19, 2007 3:30 pm

Hi,

You can optimize this code like that:


Code: Select all
cWork = "c:\myfile.tif"

ThisForm.oGdViewer1.DisplayFromFile(cWork)

ThisForm.nTotalPages = oPage.oGdViewer1.NumPages

IF ThisForm.nTotalPages > 0
   oPage.oGdViewer1.LockControl = .T.
   oPage.oGdViewer1.SetNativeImage(ThisForm.oGdViewer1.GetNativeImage)
   oPage.oGdViewer1.LockControl = .F.
   oPage.oGdViewer1.DisplayFrame(1)
ENDIF

IF ThisForm.nTotalPages > 1
   oPage.oGdViewer2.LockControl = .T.
   oPage.oGdViewer2.SetNativeImage(ThisForm.oGdViewer1.GetNativeImage)
   oPage.oGdViewer2.LockControl = .F.
   oPage.oGdViewer2.DisplayFrame(2)
ENDIF



Regards,

Loïc
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

Postby Andy Trezise » Mon Nov 19, 2007 5:14 pm

Thanks Loïc
Andy Trezise
 
Posts: 10
Joined: Wed Nov 07, 2007 1:39 am


Return to GdViewer [Pro] ActiveX

Who is online

Users browsing this forum: Bing [Bot] and 1 guest