We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Diagram with 1:1 A4 document

Thread ID:

Created:

Updated:

Platform:

Replies:

95213 Jun 26,2010 03:54 PM Jul 8,2010 08:39 AM Windows Forms 6
loading
Tags: Diagram
Franz Scharf
Asked On June 26, 2010 03:54 PM

I wanted to create a diagram with a size of A4 and metric rulers.
So I did the following (VS2008 Express, VB, WindowsApp, Form with a Diagram control):
In the designer I set this properties:
Diagram1: ShowRulers=True, HScroll=True, VScroll=True
Model1: MeasurementUnits=Millimeter, clicked the DocumentSize property > PageSize Dialog opens > I select Pre-defined size: Metric (ISO), A4: 210 mm x 297 mm > OK

After closing the PageSize Dialog I see the following properties have changed:
DocumentSize shows 827 px; 1169 px, LogicalSize shows 218,8104 mm; 309,2979 which I don't understand.. margins are set to 0..

But ok, a little bigger as I wanted.. but now the most strange thing is: after starting the app, or after compiling, closing and reopening the form in the designer I see LogicalSize changed to 57,8936 mm; 81,83509 mm and the DocumentSize in the property window of the designer now shows 218,..; 309,.. in px instead of mm.

I also tried to set the LogicalSize first and the DocumentScale to 1 mm = 1mm, entered all sizes without PageSize Dialog in mm etc..
I was not able to create an 1:1 A4 document in design view.

Thanks for your help,
Franz

Franz Scharf
Replied On June 27, 2010 08:02 AM

I found out the problem only exists when setting this properties in the designer.
If I set the properties in the FormLoad event I get what I wanted.

Thanks,
Franz

This is the code I use now in the Form Load event:

Me.Diagram1.View.PageBorderStyle.MeasureUnit = MeasureUnits.Millimeter
Me.Diagram1.View.Grid.MeasureUnit = MeasureUnits.Millimeter
Me.Diagram1.View.Grid.HorizontalSpacing = 5
Me.Diagram1.View.Grid.VerticalSpacing = 5
Me.Diagram1.View.Grid.DashOffset = 0
Me.Diagram1.View.Grid.GridStyle = GridStyle.Line

Model1.MeasurementUnits = MeasureUnits.Millimeter
Model1.LogicalSize = New SizeF(210, 297)
Model1.DocumentScale = New PageScale("A4", 1, MeasureUnits.Millimeter, 1, MeasureUnits.Millimeter)
Model1.DocumentSize = New PageSize("A4", 210, MeasureUnits.Millimeter, 297, MeasureUnits.Millimeter)

Me.Diagram1.ShowRulers = True

Franz Scharf
Replied On June 27, 2010 09:43 AM

So, finally I still need your help.

In this metric A4 document or diagram I wanted to use Nodes or Shapes also with MeasurementUnit set to Milimeter.
When I resize a shape I see the size also snaps perfectly to the 5 mm x 5 mm grid.
But.. after resizing the shape jumps somwhere in the document and also the pinpoint and pinpointoffset change to strange values.

This happens only if the shape has another MeasurementUnit than pixel. But with pixel as MeasurementUnit the size does not snap to the grid when resizing and I cannot be sure the shape grows or shrinks in exactly 5 mm steps.

I don't know if this maybe is a bug, or maybe I need a completly other approach for what I wanted to do.

Thanks for your help,
Franz

Melba Winshia [Syncfusion]
Replied On June 28, 2010 07:24 AM

Hi Franz,

Thank you for contacting Syncfusion Support.

If you are using Grid MeasurementUnits as 'Millimeter' instead of Pixel, then the HorizontalSpacing and VerticalSpacing values must be also converted to Millimeter as shown below:

Dim horizontalspacing As Single = 15
Dim verticalspacing As Single = 15
horizontalspacing=MeasureUnitsConverter.Convert(horizontalspacing,MeasureUnits.Pixel,MeasureUnits.Millimeter)
verticalspacing = MeasureUnitsConverter.Convert(verticalspacing, MeasureUnits.Pixel, MeasureUnits.Millimeter)
diagram1.View.Grid.HorizontalSpacing = horizontalspacing
diagram1.View.Grid.VerticalSpacing = verticalspacing

Please try this and let me know if this helps.

Thanks,
Melba

Franz Scharf
Replied On June 28, 2010 03:47 PM

Hi Melba,
thanks for your reply.
The GridSpacing is not the problem.
When I set
Me.Diagram1.View.Grid.MeasureUnit = MeasureUnits.Millimeter
Me.Diagram1.View.Grid.HorizontalSpacing = 5
Me.Diagram1.View.Grid.VerticalSpacing = 5

I get a perfect Grid with 5 mm spacings.

The problem is the MeasurementUnit of Shapes in Milimeter.

To see what I mean you can do the following:
Run your Diagramsample in Windows Forms Vol 2 > Diagram samples > In Code > Simple Flow Diagram.
Select a shape and in the property editor set the MeasurementUnits property of the shape to Milimeter. Then resize this shape with the mouse > the shape will change it's position and jump somewhere in the upper left corner of the document.

Thanks for your help,
Franz

Melba Winshia [Syncfusion]
Replied On June 29, 2010 08:23 AM

Hi Franz,

Thank you for the update.

I am able to reproduce this issue. I will analyze more on this issue and will update you with more details on or before July 1, 2010.

Please let me know if you have any concerns.

Thanks,
Melba

Melba Winshia [Syncfusion]
Replied On July 8, 2010 08:39 AM


Hi Franz,

I regret for the delayed response.

The issue "After resizing the shape jumps somewhere in the document and also the pinpoint and pinpointoffset change to strange values" with Diagram Control has been confirmed as a defect and the fix will be made available within 15 business days. This fix will be included in our upcoming Essential Studio Volume 4 release which is tentatively scheduled in the Mid of October. We will update you further when the release is out.

But, if you are interested in getting this fixed in your specific version, then we would be able to provide you with a patch in that specific version. Now, could you please let us know, if you would want a patch or would you prefer to wait for our main release?

Note : Syncfusion Inc , holds the right to include or exclude a defect fix or feature implementation into a specific release depending upon the stability of the product. Please be advised that the inclusion of a defect fix or feature implementation into a specific main release version is purely a decision of the Syncfusion product management team and is subjected to changes.

Regards
Melba

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;