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

Notification

Icon
Error

Options
Go to last post Go to first unread
idekkers  
#1 Posted : Saturday, July 24, 2010 5:53:49 PM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

with your great help i managed to save the workarea with and without the background.

is it possible to do the same while maintaining all the layer so it's possible to continue editing it later ?

thanks
Dmitry.Obukhov  
#2 Posted : Sunday, July 25, 2010 6:05:12 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Thank you for your question.

You are able to save the canvas as serialized data, using the Serialize() method. The canvas will be saved completely with its content.
Then to continue editing you are able to deserialize the canvas and its layers. To do it you should use theDeserialize() method.

If you have additional questions or some problems, please feel free to let me now.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#3 Posted : Saturday, October 23, 2010 6:39:58 PM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

Hi again

I've been trying to save the data, and for some reason it does not work,
when i prompt the data to a JS alert i see the data is there,
but when i try to save it, it does not work for some reason, is there a preferred way to do the save ?
I'm using SQL2005, is there a field that is better suited to save the data ?

do you have a demo of this?
thanks
Dmitry.Obukhov  
#4 Posted : Sunday, October 24, 2010 9:34:35 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Please check the field of database, where you save serialized data. It should have data type: ntext.

I recommend you to save serialized data in file. Here is code snippet how to implement it:
Code:

string data = Canvas.Serialize();
    using (StreamWriter sw = File.CreateText("fileName"))
    {
       sw.Write(data);
    }

Edited by user Monday, October 25, 2010 3:05:13 PM(UTC)  | Reason: Not specified

Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#5 Posted : Monday, October 25, 2010 7:37:30 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

will try a file, and you probably meant ntext? not intext?
Dmitry.Obukhov  
#6 Posted : Monday, October 25, 2010 3:06:01 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Sorry for this mistake. Sure, I meant "ntext";
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#7 Posted : Tuesday, November 30, 2010 7:12:36 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

Hi again

i managed serialize the canvas.
now what i did to deserialize is was to first serialize it to a string,
clear the canvas, and then deserialize the string back to the canvas.

this gives me an error, any idea what i did wrong?
Dmitry.Obukhov  
#8 Posted : Wednesday, December 1, 2010 3:14:28 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Could you please provide me with a code snippet you use? I need to check it.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#9 Posted : Wednesday, December 1, 2010 6:18:02 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

Code:

string ser = photoLabel.CanvasViewer.Canvas.Serialize();
photoLabel.CanvasViewer.Canvas.Clear();
photoLabel.CanvasViewer.Canvas.DeSerialize(ser);

could be some spelling errors here - it's from memory.
the actual code is spelled OK.
Dmitry.Obukhov  
#10 Posted : Thursday, December 2, 2010 12:38:08 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

I tested your code. It worked okay. There was a mistake: you try to call DeSerialize(ser) method instead of Deserialize(ser). Please use this code:
Code:
 string ser = photoLabel.CanvasViewer.Canvas.Serialize();
photoLabel.CanvasViewer.Canvas.Clear();
photoLabel.CanvasViewer.Canvas.Deserialize(ser);
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#11 Posted : Monday, December 13, 2010 12:15:39 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

still getting an error:

Code:

Line 349:		{
Line 350:			if (l != _photoLayer && l != _regionLayer && !string.IsNullOrEmpty(l.Name))
Line 351:				yield return new NamedRectangleRegion(l.Name, new RectangleF(l.Region.Left, l.Region.Top, l.Region.Width, l.Region.Height));
Line 352:		}
Line 353:	}

in PhotoLabelControl.ascx.cs for line 351
maybe i have an older version that i don't know of?

Edited by user Monday, December 13, 2010 12:16:19 AM(UTC)  | Reason: Not specified

Dmitry.Obukhov  
#12 Posted : Wednesday, December 15, 2010 9:56:10 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

I need additional information on the error you get. Could you please provide me with stack trace of this error? Also, please let me know what version number of Graphics Mill you use.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#13 Posted : Sunday, December 19, 2010 1:39:39 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

this is the error i get:
Code:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 349:		{
Line 350:			if (l != _photoLayer && l != _regionLayer && !string.IsNullOrEmpty(l.Name))
Line 351:				yield return new NamedRectangleRegion(l.Name, new RectangleF(l.Region.Left, l.Region.Top, l.Region.Width, l.Region.Height));
Line 352:		}
Line 353:	}


this is the stack trace:
Code:

[NullReferenceException: Object reference not set to an instance of an object.]
   <GetRegions>d__4.MoveNext() in c:\projects\cakes\store\PhotoLabelControl.ascx.cs:351
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +7667044
   ASP.store_editor_aspx.__RenderContent2(HtmlTextWriter __w, Control parameterContainer) in c:\projects\cakes\store\editor.aspx:41
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


if i comment the : Deserialize line, the file is saved successfully, and i get no error
Dmitry.Obukhov  
#14 Posted : Wednesday, December 22, 2010 5:07:26 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

Sorry for the delay.

I tested the both of these methods to serialize and desterilize canvas. However, they worked okay. I got no errors.

Could you please provide me with the link to your site, and steps how to reproduce this problem.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#15 Posted : Tuesday, November 22, 2011 1:00:59 PM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

Hi again

this was on the back burner for a while, but i still didn't manage to get it working - same errors.

if you want i can send you a zip of the file?

Ido
Dmitry.Obukhov  
#16 Posted : Wednesday, November 23, 2011 2:58:45 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Ido, please clarify what are you talking about.
Quote:
if you want i can send you a zip of the file?

Yes, please. It would be helpful.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#17 Posted : Wednesday, November 23, 2011 4:16:20 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

Hi

the problem is the same as described in the earlier post of this thread -
same code, same errors.

i'm attaching the file.

the problematic function is the last one in the file.
i comment everything in the function except for the 3 lines above, and click the save button.

the work is saved, the only problem in loading the saved data back to the canvas
File Attachment(s):
editor.zip (10kb) downloaded 2 time(s).
Dmitry.Obukhov  
#18 Posted : Friday, November 25, 2011 3:05:33 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

I looked through your code. I made my own tests of serializing and deserializing. The methods worked fine for me. Could you please provide me with information on the version of Graphics Mill you use now? Also, if it is possible please provide me with a test link to your page where you experience problem (with uncommented strings to replicate the error). If not, please share your complete sample application. It would be helpful, and allow to investigate the problem in timely manner.
Best regards,
Dmitry Obukhov
Technical Support. Aurigma, Inc.
idekkers  
#19 Posted : Sunday, December 11, 2011 12:38:09 AM(UTC)
idekkers

Rank: Advanced Member

Groups: Member
Joined: 2/27/2010(UTC)
Posts: 74

is there a mail i can send the zip of the site too?
i don't want to upload everything here?
Dmitry.Obukhov  
#20 Posted : Monday, December 12, 2011 2:07:57 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

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

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

You can submit new support ticket or send the project on this email: d.obukhov@aurigma.com
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.