Dynamic Image Dimensions based on label

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
CloudDweller Offline
Senior Member
Posts: 133
Joined: Mar 2009
Reputation: 0
Post: #1
Is it possible for the width of an image to be set based on the width of another control like a label? Here's an example of what I'm trying to achieve.

[Image: Concept.png]

Now the plan is to make the two ends and middle sections seperate images. That way the rounded ends won't distort and just the middle becomes stretched/squashed based on the labels. Could someone please tell me if what I want to achieve is possible and if so how?
(This post was last modified: 2011-10-25 17:03 by CloudDweller.)
find quote
ronie Offline
Team-XBMC Member
Posts: 8,985
Joined: Jan 2009
Reputation: 147
Post: #2
use a button control?

no need for separate images, you can use the 'border' tag to avoid distortion.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-XBMC members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
toolpunk Offline
Senior Member
Posts: 114
Joined: May 2010
Reputation: 2
Post: #3
Yeah, but I guess what he wants is something like <width min="10" max="100>auto<width> for buttons and images.
As far as I know it only works for labels at the moment.

[Image: guitarhero.png]
Meet Aerith, my first XBMC skin.
find quote
CloudDweller Offline
Senior Member
Posts: 133
Joined: Mar 2009
Reputation: 0
Post: #4
Thanks guys for replying. I'm still new to all this XBMC skinning stuff, but yes I think toolpunk's got the right idea. The text is a label with the image underneath. I don't have control over the content of the label hence the plan to stretch and squash the middle of the image.

I could use borders, but I create all images at 1080 but the code is 720 so borders does strange things I've found when moving between resolutions so if possible I'd like to avoid using them.

So sorry to sound stupid but are we saying its not going to be possible?
find quote
CloudDweller Offline
Senior Member
Posts: 133
Joined: Mar 2009
Reputation: 0
Post: #5
Or what about specifity a color for the background of the label control? That way I just have to add the two images, one at each end. Is that possible?
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,269
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #6
CloudDweller Wrote:I could use borders, but I create all images at 1080 but the code is 720 so borders does strange things I've found when moving between resolutions so if possible I'd like to avoid using them.

Your texture's dimensions will need to be divisible by 3 (and therefore your code dimensions divisible by 2) so there's no weird scaling issues.
find quote
CloudDweller Offline
Senior Member
Posts: 133
Joined: Mar 2009
Reputation: 0
Post: #7
All my images are divisible by three so fingers crossed I won't see any issues. However I'm still not sure how to achieve what I want. Can someone please point me in the right direction. Or in other words tell me what to do Wink
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,269
Joined: Aug 2007
Reputation: 80
Location: Eastleigh, UK
Post: #8
Dynamically sized textures aren't possible yet.
find quote
CloudDweller Offline
Senior Member
Posts: 133
Joined: Mar 2009
Reputation: 0
Post: #9
Sad Okay thanks for confirming.
find quote
CloudDweller Offline
Senior Member
Posts: 133
Joined: Mar 2009
Reputation: 0
Post: #10
Sorry to resurrect an old thread but I don't suppose that this has been implemented yet? If not could I please put in another request? Would be great to see it included.
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 25,685
Joined: Oct 2003
Reputation: 169
Post: #11
No, the autowidth stuff has not yet been implemented for buttons.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote