How to get UI center position on UGUI?

Hi~ I’m using UGUI(Unity 4.6) on my project.

I don’t know how to get to the center position of the UGUI.

For example, the figure below.

First I tried using the RectTransform.rect.center.

However, the result is always (0, 0). (An even shift the ‘ImageObject’ in the figure above, the position (0, 0).)

Secondly tried using the CanvasRenderer.

But when I getComponent the CanvasRenderer 'null reference, an error has occurred.

. CanvasRenderer renderer = GameObject.Find (“ImageObject”) getComponent ();

The above code has caused a null reference.

How Would I can get the center position of the UGUI?

Go to the canvas and select auto scale with the screen and the image will always stay in the place u wanted no matter how big your screen is it will not move

Canvas → Canvas → Render Mode →
Screen Space Camera
OR
use World Space ( if you want adapt size and move ).