[mythtv-theming] How to center a fixed size image in a screen.
Joey Morris
rjmorris.list at zoho.com
Fri Jul 19 11:06:54 UTC 2013
Jean-Yves Avenard <jyavenard at gmail.com> wrote on Fri, Jul 19, 2013 at 10:35:43AM +1000:
> I want to display a 512x512 image, centered horizontally but be in y=0.
>
> So far I have this, which according to the doc should do the trick:
>
> <statetype name="mediastate">
> <area>0,0,100%,100%</area>
> <state name="ok"/>
> <state name="noartwork">
> <area>0,0,100%,100%</area>
> <imagetype name="imageartwork">
> <!-- Artist: Vargas21
> http://www.iconarchive.com/show/aquave-metal-icons-by-vargas21/Music-icon.html
> -->
> <filename>noartwork512.png</filename>
> <area>-1,0,512,512</area>
> </imagetype>
> </state>
> </statetype>
>
> Now that shows in the upper right corner.
>
> So I tried setting the theme size as 1920x1080
> and used absolute coordinate:
> <statetype name="mediastate">
> <area>0,0,100%,100%</area>
> <state name="ok"/>
> <state name="noartwork">
> <area>0,0,100%,100%</area>
> <imagetype name="imageartwork">
> <!-- Artist: Vargas21
> http://www.iconarchive.com/show/aquave-metal-icons-by-vargas21/Music-icon.html
> -->
> <filename>noartwork512.png</filename>
> <area>704,0,512,512</area>
> </imagetype>
> </state>
> </statetype>
>
> 704 = (1920-512) / 2
>
> But this makes the image be displayed on the right hand side on a
> 1280x720 screen (the documentation states that coordinates are
> recalculated/scaled to adjust on the actual size) but my experience
> with this is that it doesn't occur.
>
> So.... trying to bypass what seems wrong..
>
> How do I make my image centered horizontally ?
>
> Thanks
To center horizontally, I would try setting the area to:
<area>50%-256,0,512,512</area>
My reading of the wiki makes me think the -1,-1 syntax works only for
centering windows. For non-window elements, an x of -1 means the
element starts 1 pixel to the left of its parent.
More information about the mythtv-theming
mailing list