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

GDIUtils.CalculateCenter

Hello Vallarasu

I have a question about the GDIUtils.CalculateCenter
DOC DESCRIPTION: Calculates X and Y coordinates to place object at the center of the rectangle.

- Is there a sample demonstrating usage
- I’m assuming that knowing the center means knowing the rectangle… how do I get the html element rectangle’s size (width and height) and left/top (X and Y position)
o relative to the visible control
o relative to the html document width and height

Thanks,

Randolph


1 Reply

IM Iniyen M A Syncfusion Team June 29, 2011 08:36 AM UTC

Hi Randolph,

Thanks for your interest in Syncfusion products.

CalculateCenter(Rectangle rect, Size sz) is point class which returns the Point with X and Y coordinates of center

Parameter "rect" resembles Destination rectangle and "sz" Object size.

For more information i have included the code snippet as follows.

Point pt = Syncfusion.HTMLUI.Base.Utility.GDIUtils.CalculateCenter(this.ClientRectangle, this.ClientSize);

Kindly refer the sample "Element Coordinates" to get the elements Width and height.

Please Let us know if you need further assistance.

Regards,
Iniyen M.A.


Loader.
Live Chat Icon For mobile
Up arrow icon