Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Andy79  
#1 Posted : Monday, August 6, 2012 10:34:43 PM(UTC)
Andy79

Rank: Member

Groups: Member
Joined: 7/31/2012(UTC)
Posts: 14

Thanks: 6 times
Was thanked: 1 time(s) in 1 post(s)
Hi, is client side cloning available for the .NET AJAX CanvasViewer?

I'm trying to clone the current VObject without success. Running the following javascript method causes the CanvasViewer to become unresponsive.

Code:
                 function Clone() {
                     var canvasViewer = $find("<%= CanvasViewer1.ClientID %>");
                     var cv = canvasViewer.get_canvas();
                     var vo = cv.get_currentVObject();
                     if (vo == null) return;

                     cv.beginUpdate();
                     vo.Transform.Clone();
                     cv.endUpdate();
                 }


Any help with this would be appreciated!

Thanks,
Andy

Edited by moderator Monday, April 15, 2013 6:13:49 PM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#2 Posted : Wednesday, August 8, 2012 12:53:02 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Andrew,

Unfortunately your code will not work. You have used Transform.clone method, which copies object's transforms only.
In your case I would like to recommend you to use Serialize and Deserialize methods (server-side ones) to copy and paste VObject.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
thanks 1 user thanked Dmitry.Obukhov for this useful post.
Andy79 on 8/8/2012(UTC)
Andy79  
#3 Posted : Wednesday, August 8, 2012 10:39:58 PM(UTC)
Andy79

Rank: Member

Groups: Member
Joined: 7/31/2012(UTC)
Posts: 14

Thanks: 6 times
Was thanked: 1 time(s) in 1 post(s)
Thanks Dmitry,

I'll use the server side methods instead.
fit2page  
#4 Posted : Friday, September 21, 2012 4:35:03 AM(UTC)
fit2page

Rank: Member

Groups: Member
Joined: 3/15/2012(UTC)
Posts: 10

Thanks: 1 times
Dmitry.Obukhov wrote:
Andrew,

Unfortunately your code will not work. You have used Transform.clone method, which copies object's transforms only.
In your case I would like to recommend you to use Serialize and Deserialize methods (server-side ones) to copy and paste VObject.


Hi Dmitry,
Do you have some coded example on how to copy a layer through Serialization/ Deserialization?

Thanks,
Marc
Dmitry.Obukhov  
#5 Posted : Monday, September 24, 2012 1:25:16 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Mark,

This is very simple code snippet:
Code:

string ser = photoLabel.CanvasViewer.Canvas.Serialize();
photoLabel.CanvasViewer.Canvas.Clear();
photoLabel.CanvasViewer.Canvas.Deserialize(ser);
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.