why the function OnBecameVisible and OnBecameInvisible doesn't work in canvas renderer ?

Today I used OnBecameInVisible or OnBecamInvisible to make sure when the image is visible or invisible from mask ,so I can do something at that moment. But it doesn’t work .Why other gameobject works as usual?And what should I do for this?

seems because it checks 3D stuff…

try this solution: https://forum.unity3d.com/threads/test-if-ui-element-is-visible-on-screen.276549/#post-2978773