Preview file with gdViewer lock files....

Discussions about document viewing.
Post Reply
sarzan
Posts: 25
Joined: Thu Jul 05, 2007 12:07 pm
Location: Florence - Italy

Preview file with gdViewer lock files....

Post by sarzan » Fri Sep 07, 2007 2:24 pm

I m using version 3,9005 of gdViewer (included in gdPicture Pro control).

When i use the .DisplayFromFile method the source file is locked. Other application can access it read only.
And more.. if i close the application without close the picture first (using .closepicture or .close2picture method) the file remain locked until the system reboot (this is a critical issue).

I try this simple workaround:

Code: Select all

gdViewer1.DisplayFromFile (sTmpFile)
gdViewer1.Close2Picture
In this way the file don't lock and the picture still display on gdViewer, BUT i can do any action on it like setting the zoom factor (es. .ZoomMode = ZoomToViewer produce no effect).

There is a way to load the image in the viewer, release the file, and menage it ?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Post by Loïc » Sun Sep 09, 2007 11:11 pm

Hi Sarzan,
When i use the .DisplayFromFile method the source file is locked
You can switch the ImageForceTemporaryMode property to True to keep the source file unlocked.

if i close the application without close the picture first (using .closepicture or .close2picture method) the file remain locked until the system reboot (this is a critical issue).
Into the next release, all the images opened & created by the GdViewer and the cGdPicture classes will be removed automatically on the application shutdown.

Code: Select all

There is a way to load the image in the viewer, release the file, and menage it ?
Yes, you can do that using the GdPicture Pro component like that:

Code: Select all

Dim oGdPicture as new GdPicturePro.cGdPicture
dim nNewImageHandle as long

nNewImageHandle = oGdPicture.CreateClonedImageI(GdViewer1.GetNativeImage())
GdViewer1.ClosePicture()
GdViewer1.SetNativeImage(nNewImageHandle)

Best regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests