Mailing List Archive

How to center a fixed size image in a screen.
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
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-theming
Re: How to center a fixed size image in a screen. [ In reply to ]
Jean-Yves Avenard <jyavenard@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.

_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-theming
Re: How to center a fixed size image in a screen. [ In reply to ]
On 19 July 2013 21:06, Joey Morris <rjmorris.list@zoho.com> wrote:

> 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.

that works thanks !

what I don't get however, is that today <area>704,0,512,512</area>
works too on my test system with a 800x600 screen

so a tad confused
_______________________________________________
mythtv-theming mailing list
mythtv-theming@mythtv.org
http://www.mythtv.org/mailman/listinfo/mythtv-theming