Canvas width changed if i change resolution in game view, how i can get canvas width in code?

just assign your canvas’s RectTransform to a new field in your script
and get the width by using RectTransform.sizeDelta.x