Unity 5 Simple UI Image scale via Code.

I have searched for an hour now over google they all say it is RectTransform.sizeDelta = new Vector2 (x,y)
Only problem is it says “An instance of type RectTransform is requered to access non static member sizeDelta” I apply code to UI Image itself. Is tehre anything I am doing wrong?

Nevermind I found a way to use Mask and then muve health bar to the left so its looks like its dissapearing.