This should horizontally and vertically center an image in any slot:
i = image 'your-image.png', :margin_top => '50%', :margin_left => '50%'
iw, ih = imagesize 'your_image.png'
i.move i.left-(iw/2.0).round, i.top-(ih/2.0).round
Cheers,
Kyle
On Feb 26, 2009, at 12:56 AM, Andre Nathan wrote:
On Wed, 2009-02-25 at 21:33 +0000, Kyle King wrote:
Changing width to parent.width outputs 600 in both cases.
Thank you, that worked. However, I don't think that's what I need...
what I was trying to keep the image centered regardless of the window
size, like ":align => center" does for text. Is there a way to do
that?
Thanks,
Andre