Loading...

Can not SaveAs modified image

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Can not SaveAs modified image

Postby madi1270 » Thu Feb 04, 2010 8:31 am

Hi...

I'm trying to save the modified image to the same file name. GdpictureImaging.getStat() return me 7 (win32error), which I believed cause by trying to save image on the same image that my application currently working on. The SaveAs* function works just fine when I save to different file name. I need to replace current image that I'm working on with the new one (after did some image manipulation). Any work around? Maybe I did it a wrong way...

My sample code:
Code: Select all
//Initially display image from file
oGdPictureViewer.displayfromfile('C:\my_image\test.gif')
ll_imageID = oGdPictureViewer.GetNativeImage
oGdPictureImaging.SetNativeImage(ll_imageID)

//-------------------------
Did some image manipulation - add text, shape etc ........
//-------------------------

//Save the changes
oGdPictureImaging.SaveAsGIF('C:\my_image\test.gif')


Here SaveAsGIF failed and when I check GdpictureImaging.getStat(), it return me 7 (win32error).

I try doing these:
Code: Select all
//Save the changes
ll_cloneid = oGdPictureImaging.CreateClonedImage(ll_imageID)
oGdPictureImaging.CloseImage(ll_imageID)
oGdPictureImaging.setNativeImage(ll_cloneid)
oGdPictureImaging.SaveAsGIF('C:\my_image\test.gif')


But it still failed to save !!
Any idea??? I believed I did it a wrong way. Some one please guide me ...

Regards
MUL
madi1270
 
Posts: 5
Joined: Wed Jan 13, 2010 11:21 am

Re: Can not SaveAs modified image

Postby madi1270 » Thu Feb 04, 2010 9:15 am

Hi...
FYI... I did some more testing with other file format. It seems that SaveAsGIFF, SaveAsPDFAEX & SaveAsPNG failed when I try to save to the same file name.

Other format like TIF, JPG & ICO works just fine.

Regards
MUL
madi1270
 
Posts: 5
Joined: Wed Jan 13, 2010 11:21 am

Re: Can not SaveAs modified image

Postby Loïc » Thu Feb 04, 2010 9:51 am

Hi,

Please try with CreateClonedImageI instead of CreateClonedImage.

Kind regards,

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

Re: Can not SaveAs modified image

Postby madi1270 » Thu Feb 04, 2010 11:00 am

Hi..
Thank you for your quick reply...

I just did that...

My code :
Code: Select all
Private nImageID As Integer
Private sFileName As String

Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
        Imaging1.SetLicenseNumber("xxxxxxxxxxxxxxxxxxxxxxxxx")
        GdViewerCnt1.SetLicenseNumber("xxxxxxxxxxxxxxxxxxxxxxxxx")

        sFileName = "C:\test\pic\test1.gif"
        GdViewerCnt1.DisplayFromFile(sFileName)

        nImageID = GdViewerCnt1.GetNativeImage()
        Imaging1.SetNativeImage(nImageID)
End Sub

Private Sub ButtonSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonSave.Click
        Dim nClonedImage As Integer

        nClonedImage = Imaging1.CreateClonedImageI(nImageID)
        Imaging1.CloseNativeImage()
        Imaging1.SetNativeImage(nClonedImage)

        Imaging1.SaveAsGIF(sFileName)

        If Imaging1.GetStat() = 0 Then
            MsgBox("Done")
        Else
            MsgBox("Failed")
        End If
    End Sub


unfortunately... still failed to save.

Regards
MUL
madi1270
 
Posts: 5
Joined: Wed Jan 13, 2010 11:21 am


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron