|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Aligning Images
I have a few ideas for STVi's, so I've been working through the Studio tutorials trying to figure things out.
I'm having trouble getting images aligned the way I want them. I have 2 images (a genre icon, and a poster image), and I want the genre icon to be overlayed at just the right position on top of the poster (see attachment right.jpg for an example). I've messed around with all the settings I can think of, but I can't see to make the poster stay in the right position when the UI is resized (see attachment wrong.jpg). The only way I've found to keep them aligned to one another is to specify all the coordinates/widths/heights in pixels. The problem with this though, is that nothing scales at all when the UI is resized. Any ideas what I'm doing wrong? Thanks. |
#2
|
||||
|
||||
Hard to say for sure without seeing your code, but I'm guessing what's happening is that you have the image width set to a fixed fraction of the container width. As the container shrinks, the image width shrinks in proportion, dragging the height down with it to maintain the source image's aspect ratio.
But it's not really the width you want to control, it's the height. You want the height to be a fixed fraction of the container height, and the width to be as wide as it needs to be to accomplish that. Probably the simplest approach is to make the width much wider than you need, and right-align the image within its bounding box, so that it grows to the left as needed. If you want to get more compicated, you can use GetFullUIWidth() and GetFullUIHeight() to calculate the UI's aspect ratio and factor that into your image width calculation, so that the width becomes a fixed fraction of the overall UI height.
__________________
-- Greg |
#3
|
|||
|
|||
Thanks for the reply.
I was using fixed width, like you thought. I switched to fixed height and it fixes the moving up/down problem, but now it drifts slightly left/right (not a lot, but it's noticeable). Here's the code as it currently is: Quote:
|
#4
|
||||
|
||||
You have a HorizontalAlignment of 0.95 on one image and 0.96 on the other, so that could account for some discrepancy as the overall width changes. Personally I'd suggest aligning them both at 1.0 to make them immune to width changes, and using insets on the container if you need more space to the right.
__________________
-- Greg |
#5
|
|||
|
|||
If I align them both to 1.0, then they don't line up (the genre image has a small transparent gap on the right side). I tried using insets for spacing, but it creates the exact same problems when resizing.
Any other ideas? Thanks for the help. |
#6
|
||||
|
||||
Can't you edit the image to trim away any blank border, so that the bounding box fits tight to the visible edges? Then aligning to 0.0 or 1.0 should do what you'd expect, i.e. flush the visible edge of the image up against the edge of the container.
The alternative is going to be to do a lot of explicit calculations on image widths and heights, taking the UI aspect ratio into account, in order to get things exactly where you want them.
__________________
-- Greg |
#7
|
|||
|
|||
Quote:
I currently use a few in some of my imports but to be honest I don't know what they mean I've looked around the forums, Studio tutorials and searched google but nothing explains what they mean. A few examples of what I've used/seen: Code:
=.5625*GetFullUIWidth()/GetFullUIHeight() =If(Height != null, Height, null) =If( 0.5625*GetFullUIWidth()/GetFullUIHeight() < 0.75 , 1.0 - 0.5625*GetFullUIWidth() =GetProperty( "amis/jaminben/menuadvancedposition/X" , 0.05 )*GetFullUIWidth()/GetFullUIHeight() Code:
Fixed Width = 1.0 *GetFullUIHeight() / GetFullUIWidth() * GetProperty( "amis/jaminben/menuadvanced/SX" , 2.0 ) Fixed Height = 1.0 * GetProperty( "amis/jaminben/menuadvanced/SY" , 0.08 ) Any help would be greatly appreciated even if its a link to a tutorial or guide. However I'm shooting completely in the dark and have no idea about programming so if its just too complicated to explain don't worry. I'll keep plodding on until I break something drastically and then give up. Many Thanks Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 02-03-2009 at 08:57 AM. |
#8
|
||||
|
||||
Quote:
If you want the width of your panel to be a specified fraction of the screen height, that's when you'd need to scale your values by GetFullUIHeight()/GetFullUIWidth(). Assuming a 16x9 screen, an input value of 1.0 would translate to ~0.56 of the screen width, making the panel width equal to the screen height. To get full screen width, you'd need to specify an input value of 1.777. For the rest of your examples, it's hard to say what the right calculation ought to be without knowing what those specific examples are trying to achieve.
__________________
-- Greg |
#9
|
|||
|
|||
Quote:
Code:
Fixed Width = 1.0 *GetFullUIHeight() / GetFullUIWidth() * GetProperty( "amis/jaminben/menuadvanced/SX" , 2.0 ) Code:
Fixed Width = 1.0 *GetFullUIHeight() / GetFullUIWidth() * GetProperty( "amis/jaminben/menuadvanced/SX" , 1.777 ) However their is no real need to do that as the object was to make sure the menu stretched the full length of the screen when someone imported it for the first time. So setting a value of 2.0 maybe overkill for general use but its not strictly wrong. Or am I getting it wrong? Cheers Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SageMC: not saving IMDB images | gilded07 | SageMC Custom Interface | 18 | 01-05-2009 06:47 PM |
IMDB description not downloaded and Where do TV series images come from? | dinki | SageMC Custom Interface | 9 | 07-28-2008 02:37 PM |
Movie database images | jaminben | SageTV Media Extender | 0 | 06-09-2008 05:47 AM |
Background Images | sagetvkid | SageTV Studio | 1 | 06-02-2006 09:03 PM |