| 
Rank: Member
 Groups: Guest
Joined: 7/31/2012(UTC)
 Posts: 14
 
 Thanks: 6 timesWas 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 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
         
		   
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 5/29/2010(UTC)
 Posts: 1,310
 
 Thanks: 8 timesWas 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.
 | 
	
    | 
              1 user thanked Dmitry.Obukhov for this useful post. |  | 
    |  | 
        
        
        
    
		
        
            
            
	
    | 
Rank: Member
 Groups: Guest
Joined: 7/31/2012(UTC)
 Posts: 14
 
 Thanks: 6 timesWas thanked: 1 time(s) in 1 post(s)
 
 | 
            
	      
                Thanks Dmitry,
 I'll use the server side methods instead.
 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
         
		   
        
            
            
	
    | 
Rank: Member
 Groups: Guest
Joined: 3/15/2012(UTC)
 Posts: 12
 
 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 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
    
		
        
            
            
	
    | 
Rank: Advanced Member
 Groups: Guest
Joined: 5/29/2010(UTC)
 Posts: 1,310
 
 Thanks: 8 timesWas 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.
 | 
	
    | 
             | 
            
         | 
    |  | 
        
        
        
    
    
        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.