Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Custom Serialization (Read 7423 times)
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Custom Serialization
Dec 12th, 2007 at 2:27am
Print Post  
Hi,
I have a requirement to store the image data efficiently in SQL server which can be reused to reconstruct the image.
I can save the image in binary format and save it on database. However requiremnt is to reduce the size of the file otherwise data will not fit into varbinary data type in sql server (8 KB ax max limit). Alternatively we do not want to store the image as blob in the DB. (which has a limit of 2 GB)
I can think of a way in which i will perform custom savin of data in sql server. For example i can store only the top left point of a box and save its coordinate in a table. Similarly for a line i can fetch the points in spline and store the corodinates in a table.
Do u have a code snippet which could act as starting point for me otherwise i am planning to do it from scratch.

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #1 - Dec 12th, 2007 at 8:48am
Print Post  
Hi,

I'm afraid we don't have any sample code that does that. If this isn't urgent, for the next release of NetDiagram we could create a new sample project that demonstrates storing the flowchart data in a database.

Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #2 - Dec 14th, 2007 at 2:51am
Print Post  
Hi,
Thanks. When is next version scheduled to released. What are the additional features planned in this release. Does it have any cost implication etc. ?

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #3 - Dec 14th, 2007 at 6:13am
Print Post  
Hi,

Version 1.0.3 is scheduled for January. It will provide the following:

- a server-side Overview control for both image-map and applet modes (the .jar file already contains an OverviewApplet class that you can load using the APPLET tag)
- a server-side ShapeListBox control for the applet mode (the ShapeListBoxApplet already exists and you can load it using an APPLET element)
- imagemap mode will split the diagram image into multiple smaller parts, which will allow displaying much larger diagrams. Currently you cannot create ones larger than ~3000x3000 pixels because of GDI.NET limitations.
- there will be some new layout algorithms and improvements to the current ones.

You receive all updates released in the first year after buying a license for free.

Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #4 - Dec 26th, 2007 at 7:04am
Print Post  
Hi,
Thanks for the info. Meanwhile I happned to put some hands on this issue. I saved the x, y values of all the boxes and control points in an arrow in a database. Then I tried to reconstruct the image from those values. My observation was while drawing the boxes is quite easy. For arrow it is bit tricky. I was able to draw a line by providing the start and end node but doing this will not restore the image in its exact format (because of arrow rerouting).
I tried to create an arrow by using the control points. I used the following steps -

1. Create an arrow
2. Add control points
3. Update the arrow

However i could not get the desired result. Possibly u can throw some light on this.

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #5 - Dec 26th, 2007 at 10:02am
Print Post  
Hi,

Do not add control points directly to the collection, but first restore and Style and SegmentCount property values - that will automatically resize ControlPoints. Then assign new coordinates to the existing points in the collection, e.g.

arrow.ControlPoint[i] = new PointF(x, y);

Finally call arrow.UpdateFromPoints().

AutoRouted arrows don't let you change their SegmentCount, so you will have to disable that property before restoring the arrow shape. After restoring the arrow shape, set AutoRoute = true again. You must also clear all bits in FlowChart.RoutingOptions.TriggerRerouting before loading the arrows; otherwise, setting AutoRoute = true will trigger the routing function and the arrow might get a different shape again.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #6 - Dec 27th, 2007 at 8:15am
Print Post  
Hi,
Thanks. As per ur suggestion i did the modification in the code and I am able to add the control points. However arrow end point is not correct totally. Looks like one additional point is added.
I have mailed the sample code at ur support (support@mindfusion.eu).
You may have some input on this.

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #7 - Dec 28th, 2007 at 7:24am
Print Post  
Hi,

For polyline and cascading arrows, the number of segments is one less than the number of points. Change the following line:

arrow.SegmentCount = (short)arrowPoints.Length;

to

arrow.SegmentCount = (short)arrowPoints.Length - 1;

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #8 - Jan 9th, 2008 at 2:21am
Print Post  
Hi,
Is new version of NetDiagram (with serailization sample in DB) is released?

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #9 - Jan 9th, 2008 at 6:17am
Print Post  
Hi,

It hasn't been released yet.

Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #10 - Feb 27th, 2008 at 2:35am
Print Post  
Hi,
1. Is new version to store serializes image information in Database is released?

2. On the features list for NetDiagram it is mentioned that diagram could be saved into XmlDocument. How that can be achieved? Is it the same feature as suggested above?

3. We have another requirement in which we have to reverse engineer the diagram from the data (i.e. network diagram) in which we know the nodes but we have to manually arrange layout of the boxes on canvas. I have thought of a way of doing so by applying algorithms to fix the corodinates of the nodes manually. However any suggestion is appreacited.

Regards,
Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #11 - Feb 27th, 2008 at 6:03am
Print Post  
Hi,

Quote:
1. Is new version to store serializes image information in Database is released? 


No, automatic data binding is not supported yet.

Quote:
2. On the features list for NetDiagram it is mentioned that diagram could be saved into XmlDocument. How that can be achieved? Is it the same feature as suggested above? 


Use the SaveToXml and LoadFromXml methods.

Quote:
3. We have another requirement in which we have to reverse engineer the diagram from the data (i.e. network diagram) in which we know the nodes but we have to manually arrange layout of the boxes on canvas. I have thought of a way of doing so by applying algorithms to fix the corodinates of the nodes manually. However any suggestion is appreacited. 


Try the SpringLayout.Arrange() method.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #12 - Feb 28th, 2008 at 5:39am
Print Post  
Hi,
I am not able to able find this method SaveToxml in FlowChart class. I am using NetDiagram version 1.0.1. Is this feature not available in this version.

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom Serialization
Reply #13 - Feb 28th, 2008 at 8:07am
Print Post  
Hi,

With version 1.0.1 you can use the XmlWriter and XmlReader classes for XML serialization.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
vk23942
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 16
Joined: Oct 18th, 2007
Re: Custom Serialization
Reply #14 - Mar 5th, 2008 at 3:55am
Print Post  
Hi,
I am able to serialize the FlowChart object by using SaveToxml method.
However in our scenario only the box and the arrow information is changing in each diagram, rest of other information is fixed. Therefore we think that following option to reduce the size of data to be stored for each image -
1. Store the fix information somewhere else in the DB (as a pert of configuration data)
2. serialze the full flowChart, extract the relavant information from the xml (ie. Xsltransform or firing query on the dataset generated from xml)
3. Store only the extracted information in the database.

Therefore we would like to know whcih elements in the xml should be used extract the boxes and arrows related information.

Regards,

Vikas Kapoor
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint