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. Image for the cookie policy date
close icon

Rectangle with millimeter values

Hi,
I am using Diagram control. could u plz help me, how to draw rectangle with millimeter values?

Thanks in advance...


3 Replies

GM Gowri Manohari D Syncfusion Team June 4, 2009 09:18 AM UTC

Hi Mani,

Thanks for choosing Syncfusion Products.


MeasureUnit is one of the argument of Rectangle class. For your requirement we can specify the MeasureUnits as MeasureUnits.Millimeter.The below code illustrate this.

Syncfusion.Windows.Forms.Diagram.Rectangle r = new Syncfusion.Windows.Forms.Diagram.Rectangle(100,50,100, 50, MeasureUnits.Millimeter);
diagram1.Model.AppendChild(r);


Thanks & Regards,
Gowri


KU Kumar June 4, 2009 10:42 AM UTC

can u explain how this measureunits works? how it draws in millimeters instead of pixels?

Regards,
Mani



GM Gowri Manohari D Syncfusion Team June 5, 2009 12:14 PM UTC

Hi Mani,

All the graphics objects are Pixel Based representation units.The Diagram Control also Pixel Based Measurement.So whatever measure unit we specify it will convert to pixel.

For your requirement Measurement.MilliMeter , before drawing rectangle the system will convert into equivalent pixel representation.The below is the method used for conversion.

MeasureUnitsConverter.ToPixels(rectBounds, MeasureUnit.MilliMeter);


Thanks & Regards,
Gowri

Loader.
Live Chat Icon For mobile
Up arrow icon