Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Default Zoom Factor (Read 13910 times)
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Default Zoom Factor
Feb 27th, 2008 at 8:57am
Print Post  
Hi

If I put a new diagram control on a form, it's zoom factor defaults to 100.  Now because were running beta the '"trial copy" message is displayed in the upper left corner.  At zoom ofactor of 100, this text is what I would consider to be a 'normal' size and matches the default text size throughout my app.
If i create a standard diagram node, via a mouse click/drag on the diagram, it too would seem to be a 'normal' size, using the resize handles as a size guide.
If i now create a UI control and add it to the diagram, any text and overall control apears massively zoomed and the same occurrs if i create a shape node via code. 
There would seem to be a difference in the zoom effect - can you confirm if this is the case, or maybe suggest a property that I should modify?

Many thanks


Paul
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Default Zoom Factor
Reply #1 - Feb 27th, 2008 at 9:00am
Print Post  
Hi,

Could you post your ShapeNode initialization code?

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Default Zoom Factor
Reply #2 - Feb 27th, 2008 at 1:22pm
Print Post  
       Dim oshapenode As New ShapeNode
       oshapenode.Text = "Trial version"
       With oAxiomDiagram
           .Items.Add(oshapenode)
           Diagram.SetItemBounds(oshapenode, New Rect(10, 10, 100, 100))
       End With

My initial question should have also included wether zoom factor is a percentage (ie: 100 being a 'normal view', greater than being zoomed in and less than being zoomed out) or if it has bespoke meaning within the mindfusion controls.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Default Zoom Factor
Reply #3 - Feb 27th, 2008 at 1:44pm
Print Post  
Yes, it's a percentage.
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Default Zoom Factor
Reply #4 - Feb 27th, 2008 at 3:12pm
Print Post  
Hi Soyan

Thanks for the clarification of the factor meaning - as a more tangable example of this size difference, placing a button sized @ 60x32 on a diagram control @ zoom factor of 50 produces a button 50% bigger than a button with same size dimentions placed directly on a form.
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Default Zoom Factor
Reply #5 - Feb 27th, 2008 at 5:41pm
Print Post  
Are you setting the 60x32 size using the ItemBounds attached property (Diagram.SetItemBounds())? For items in the diagram that's measured in millimeters by default, while the Width and Height of form elements are measured in WPF points.

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


I love YaBB 1G - SP1!

Posts: 3
Joined: Mar 13th, 2008
Re: Default Zoom Factor
Reply #6 - Mar 13th, 2008 at 7:33pm
Print Post  
I am having this same problem, only mine is occuring when the control/node is user drawn. It is way oversized.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Default Zoom Factor
Reply #7 - Mar 13th, 2008 at 8:27pm
Print Post  
Could you post here your custom drawing code? Note that when using the default MeasureUnit of millimeters, the control applies a scale transform so that a line drawn from (0, 0) to (0, 1) is one millimeter long, and not one point long.

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


I love YaBB 1G - SP1!

Posts: 3
Joined: Mar 13th, 2008
Re: Default Zoom Factor
Reply #8 - Mar 17th, 2008 at 1:01pm
Print Post  
Ok this does appear to be the issue. I am using a user control as my node and it was created in expression blend which uses points by default. What do I need to do to have the diagram work properly with the expression default settings? I tried changing the measure unit but it is not working properly.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Default Zoom Factor
Reply #9 - Mar 17th, 2008 at 1:09pm
Print Post  
Set diagram.MeasureUnit = GraphicsUnit.WPFPoint if you need to use the WPF point units. If you change MeasureUnit, you might have to change the values of other properties too - they are listed in the MeasureUnit topic in the help file.

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


I love YaBB 1G - SP1!

Posts: 3
Joined: Mar 13th, 2008
Re: Default Zoom Factor
Reply #10 - Mar 17th, 2008 at 1:28pm
Print Post  
I am not seeing that. What else do I need to change?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Default Zoom Factor
Reply #11 - Mar 17th, 2008 at 1:53pm
Print Post  
using MindFusion.Diagramming.Wpf;

private void Window_Loaded(object sender, RoutedEventArgs e)
{
     diagram.MeasureUnit = GraphicsUnit.WPFPoint;
}

That worked for me. We haven't provided a type converter for the GraphicsUnit type, so you cannot set it from XAML yet.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Paul Eden
Full Member
***
Offline



Posts: 128
Joined: Aug 15th, 2007
Re: Default Zoom Factor
Reply #12 - Mar 17th, 2008 at 2:00pm
Print Post  
If you're using Blend though (not everyones cup of tea I admit) you can set it there via the UI.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint