server-side save with canvas=yes

5 posts, 0 answers
  1. Paul
    Paul avatar
    4 posts
    Member since:
    Feb 2013

    Posted 23 Feb 2013 Link to this post

    Hi

    I need to save an edited image server-side in an SQL database. Apparently this does not work correctly with CanvasMode set to 'yes', but I need this set to yes as I am using the new Drawing tools!

    Could you please help me achieve this. Is there a way I can successfully retrieve the edited image server-side while using the drawing tools, if not could you help provide me with a work around that perhaps retrieves the edited image client-side and then executes a server-side function that can reference the retrieved image (i.e. client-side place the image contents in a server control, and then call a server side function to save it in a database)?

    Any help would be much appreciated.

    Regards, Paul
  2. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 25 Feb 2013 Link to this post

    Hi Paul,

    I have already answered your support ticket on the subject, for convenience I am pasting my answer here as well:

    You could try using the ImageEditor's applyChangesOnServer() method, which would force the changes made to the image to be applied on the server.

    If this does not help you in solving the case - could you prepare a sample fully runnable project reproducing the issue, allowing us to examine and debug the problem locally?


    Regards,
    Vesi
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Paul
    Paul avatar
    4 posts
    Member since:
    Feb 2013

    Posted 26 Feb 2013 Link to this post

    Hi
    Unfortunately, applyChangesOnServer() does not work.

    Simple to reproduce the problem, add asp.net button and server-side code behind click as follows:
     

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

    Me.RadImageEditor1.SaveEditableImage("myImage", True)

     

    End Sub

    ...Nothing is saved.


    Regards, Paul
  5. Vessy
    Admin
    Vessy avatar
    1388 posts

    Posted 01 Mar 2013 Link to this post

    Hi Paul,

    Please, excuse me if I was not clear enough in my previous reply - the applyChangesOnServer() works properly in enabled CanvasMode only if its arguments are also configured to save the image on the server:
    • saveImageServer (type='Boolean') - if the image is to be saved on the server
    • filename (type='Object') - The filename of the image. If null then the original filename is used. If file name is not a string, but an object of format {name: "fileName", ext: "png"}, this method will change the extension of the saved image.
    • call_saveOnClient (type='Boolean') - if the image is to be downloaded on the client machine after the operations have been applied to the client.
    • overwrite (type='Boolean') - if the image is to be overwritten on the server.

    When you edit the image in CanvasMode, the only way to apply the changes from the edited canvas object to the server image is to save the image from the client. If you use directly any of the server methods (like RadImageEditor1.SaveEditableImage("myImage", True)) the newly created image would be a copy of the original image (without the changes).

    All the best,
    Vesi
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. Paul
    Paul avatar
    4 posts
    Member since:
    Feb 2013

    Posted 01 Mar 2013 Link to this post

    Hi Vesi

    Yes, I can successfully save the edited image with that method, Thanks for your help. It was confusing because there is a server-side save function which works but ignores any canvas activity, and that is not explained in the documentation, but I guess the idea is to make that also work in time?

    Regards, Paul
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017