[mythtv-theming] How to center a fixed size image in a screen.

Jean-Yves Avenard jyavenard at gmail.com
Fri Jul 19 00:35:43 UTC 2013


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


More information about the mythtv-theming mailing list