Dynamic Image Dimensions based on label - Printable Version
+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Skin Development (/forumdisplay.php?fid=12)
+--- Thread: Dynamic Image Dimensions based on label (/showthread.php?tid=113218)
Dynamic Image Dimensions based on label - CloudDweller - 2011-10-25 16:59
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.
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?
- ronie - 2011-10-25 18:29
use a button control?
no need for separate images, you can use the 'border' tag to avoid distortion.
- toolpunk - 2011-10-25 18:43
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.
- CloudDweller - 2011-10-25 19:07
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?
- CloudDweller - 2011-10-25 19:09
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?
- Hitcher - 2011-10-25 21:21
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.
- CloudDweller - 2011-10-25 21:42
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
- Hitcher - 2011-10-25 23:36
Dynamically sized textures aren't possible yet.
- CloudDweller - 2011-10-25 23:57
Okay thanks for confirming.
RE: Dynamic Image Dimensions based on label - CloudDweller - 2012-04-12 19:02
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.
RE: Dynamic Image Dimensions based on label - jmarshall - 2012-04-12 23:25
No, the autowidth stuff has not yet been implemented for buttons.