Posts: 18
Joined: Mar 2006
Reputation:
0
Posh
Junior Member
Posts: 18
anybody feel up to exposing this to us python scripters. i have looked into it but it appears to be over me at the moment. i would greatly appreciate it.
Posts: 18
Joined: Mar 2006
Reputation:
0
Posh
Junior Member
Posts: 18
thanks for your reply... that code is useful.. i use a similar function now... the problem is when someone uses a resolution outside of what i use it will strecth the picture. i have my script to set coordinates for ntsc.. but when someone uses pal or and hd res it stretches the image. now if someone uses ntsc widescreen it stretches it too but that is expected. i was hoping to get access to the aspectratio of the control image so this wouldn't be a problem. unfortunately i'm not quite proficient enough inside the xbmc code to figure out how to expose it.
Posts: 707
Joined: Jul 2004
Reputation:
6
i think you already use the :
self.setcoordinateresolution(x)
this modify positions and width/height of the gui to fit whatever resolution the user screen is.
but as for pictures, they still stretched...
you'll have to size the picture not by using just the width and height, but you'll better add a parameter which calculate the pixel ratio of the screen to adapt the picture width and height.
Posts: 18
Joined: Mar 2006
Reputation:
0
Posh
Junior Member
Posts: 18
thanks for the suggestion... i guess i should have explained a bit more in my original request. it is possible to work around the resolution and manually determine the size for each image. i guess i was thinking that xbmc already has the ability to do this without having to manually do it.... so why redo the work if it this could be exposed to python. i just don't know enough about the xbmc code to dive in and expose this ability i found out.
Posts: 707
Joined: Jul 2004
Reputation:
6
only the :
self.setcoordinateresolution(x)
stuff is actually exposed to python
Posts: 26,215
Joined: Oct 2003
Reputation:
187
- 02-05-2006 fixed: image controls from python couldn't be set to preserve aspect ratio.
Posts: 18
Joined: Mar 2006
Reputation:
0
Posh
Junior Member
Posts: 18
thanks so much for working on this. i hope it wasn't too much extra work. you wouldn't happen to remember the syntax off the top of your head would you?
thanks again.
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
controlimage(int x, int y, int width, int height[, filename, colorkey, aspectratio])
Posts: 3,909
Joined: Dec 2004
Reputation:
20
Nuka1195
Skilled Python Coder
Posts: 3,909
i played with this a little and couldn't get it to do anything. i may not understand how to use it.
i placed three images who's size is 180 x 180 on the screen at 180w x 100h. i used 0,1,2 for the aspect ratio(i think that's correct, it does want an integer). all three images appeared stretched.
is the correct entry for aspect ratio an integer (0,1,2)?
am i misunderstanding what this does?
Posts: 18
Joined: Mar 2006
Reputation:
0
Posh
Junior Member
Posts: 18
i just got the code from sourceforge and it looks to me like keep=0, scale=1, stretch=2. but i havent gotten a chance to actually test it yet so i can't confirm that it works.