View Single Post
Old 16th November 2008, 13:54   #1
Senior Member
Join Date: Oct 2006
Posts: 357
Find the actual width of an image?

I wish to have optional images added to my skin, and I need to know the size of the image. The user would supply the images as they wish. So I used the following code.
In the elements file:
<bitmap id="player.picture" file="c:\Program Files\Winamp\picture.png" gammagroup="DisplayElements"/>

In the main file:
x="250" y="3"

and in the appropriate Maki file:

Global layer GroupLogo, userpicture;
Global int GroupLogoW, userPictureW, GroupLogoX;
userPicture = frameGroup.findObject("player.user.picture");
userPictureW = stringtointeger(userpicture.getXMLParam("w"));
System.debugString("logo w,picture w "+integertostring(grouplogow)+", "+integertostring(userpicturew),9);

I would have assumed that since I did not define the size of the image that Winamp would pick it up from the actual image which is 299x37 in size. But the value returned is 200. If I have a smaller image 44x30 the value returned is zero. Obviously Winamp has the information because the image is displayed correctly without an intervention from Maki. For some reason the information is not available.

Is this a bug, oversight, or feature? Or am I doing something wrong here?
clementj is offline   Reply With Quote