Can I connect the height and the width of 2 components?

I have an image and a text over it, I’d like the text to cover the same space as the image, how could I do?

Thx