Hi there,
I've also got big problems with locked source files!
My application includes gdPictureViewer and gdImaging components.
I open a Copy of the original BMP, TIF or JPG file with the following code
(where fso is a scripting.filesystemobject, gdiDokImage is a gdImaging-Component
and gdpDokImage is a gdViewer-Component):
- Code: Select all
tmpFileName_Edit = tmpPath + "\~" + realFileName
fso.copyFile(realFileName, tmpFileName_Edit, True)
gdiDokImage.CreateImageFromFile (tmpFileName_Edit)
gdpDokImage.SetNativeImage (gdiDokImage.GetNativeImage)
then I rotate or scale it, e.g.:
gdpDokImage.Rotate90
and - last not least - I want to save the changes:
nCloneImage = gdiDokImage.CreateClonedImageI(gdiDokImage.GetNativeImage)
Ergebnis = gdiDokImage.CloseNativeImage
Call gdiDokImage.SetNativeImage(nCloneImage)
Select Case fileType
Case "JPG", "jpg"
Call fso.DeleteFile(realFileName, True)
Call gdiDokImage.SaveAsJPEG(realFileName, curJPGQuality)
Case "BMP", "bmp"
Call fso.DeleteFile(realFileName, True)
Call gdiDokImage.SaveAsBmp(realFileName)
Case "TIF", "tif"
Call fso.DeleteFile(realFileName, True)
Call gdiDokImage.SaveAsTIFF(realFileName, CompressionLZW)
End Select
then even I ill the content of the gdPictures with
gdiDokImage.CloseImage(gdiDokImage.GetNativeImage)
gdpDokImage.Clear
I only can run this code one time in case of TIF or BMP-Files, with JPG it works several times!
When i try a second saving operation the "fso.DeleteFile"-command raises an Err code 70 (Access denied)
I tried out everything I could find in this forum to solve the problem, but without success....
Why doesn't the gdPicture.ocx offer a simple SAVE-command???
It seems to be very complicated to do a saving operations, without any sense to me!! Because I WANT to
manipulate the original File.
So, I would be very glad, if anybody could help me. It's quite urgent!!
Thanks for any suggestions!!
Tobias