Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic MeasureUnit of Diagram (Read 2747 times)
CanadaProgrammer
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
MeasureUnit of Diagram
Jul 29th, 2015 at 4:09am
Print Post  
I just bought and use new version. The property MeasureUnit of Diagram was changed. My original code is below:
this.diagram.MeasureUnit = GraphicsUnit.Display;

So what is the equal code when I use new version 6.3.2
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: MeasureUnit of Diagram
Reply #1 - Jul 29th, 2015 at 5:50am
Print Post  
You could set it to MeasureUnit.WpfPoint, which is initialized to 96 units per inch, close enough to the GraphicsUnit.Display's 100 units per inch. Or otherwise define your own unit:

Code
Select All
var displayUnit = new MeasureUnit(
	25, "Display", MeasureUnitType.Logical, 100, 10);
diagram.MeasureUnit = ruler.Unit = displayUnit; 



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


I love YaBB 1G - SP1!

Posts: 113
Joined: Jun 30th, 2011
Re: MeasureUnit of Diagram
Reply #2 - Jul 29th, 2015 at 6:01am
Print Post  
Changed code as same as what you show me. But there is a exception, message is:"An item with the same key has already been added"
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: MeasureUnit of Diagram
Reply #3 - Jul 29th, 2015 at 7:02am
Print Post  
You should call MeasureUnit constructor just once if specifying integer id argument, move it to application startup code or static constructor.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint