This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Remote Method

I am trying to invoke a remote method through JS:

function Flip(){
var frontPsdEditor = $find("<%= ClientID %>");
var cv = frontPsdEditor.get_canvas();
cv.invokeRemoteMethod("FlipImage");
cv.redraw();
}

The server code:

[Aurigma.GraphicsMill.AjaxControls.RemoteScriptingMethod()]
public void FlipImage(Object sender, CommandEventArgs e) {
var imageLayer = CanvasViewer.Canvas.Layers.Where(l => l.Name == "imageUG").FirstOrDefault();
ImageVObject imgorg = (ImageVObject)CanvasViewer.Canvas.CurrentVObject;
var bitmaporg = (Aurigma.GraphicsMill.Bitmap)imgorg.Bitmap;
Aurigma.GraphicsMill.Transforms.RotateAndFlip rotateAndFlip = new Aurigma.GraphicsMill.Transforms.RotateAndFlip();
rotateAndFlip.Mode = System.Drawing.RotateFlipType.RotateNoneFlipX;
rotateAndFlip.ApplyTransform(bitmaporg);

}

The VObject is not updated after applying the Flip?
What am I missing?

Marc


Hello Marco,

<%= ClientID %> returns "__Page". You should set the correct ID of the canvasViewer. Please check it.
Useful and informative shared you have published with us . Liked and appreciate your post, thanks .