MultiImage Control: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>NedBot
m (Bot: Removing from Category:HTTP API)
Line 22: Line 22:
=== Image Size and Type Restrictions ===
=== Image Size and Type Restrictions ===
For the <texture> tags, and for all <texture> tags in other controls, there is a small set of rules that you should follow if at all possible:
For the <texture> tags, and for all <texture> tags in other controls, there is a small set of rules that you should follow if at all possible:
==== Size ====
Images can be any size you like if background loading them from outside the Textures.xbt file, though using anything larger than the size of the control you're rendering is a waste of processor and memory. If they're in Textures.xbt, then they're usually contained within textures that are a multiple of 64 pixels wide.
For optimal memory consumption, then, a multiple of 64 pixels wide should be used.
For non-xbox platforms, this is a moot point.
==== Formats ====
==== Formats ====
If you wish to use full 8 bit transparency, then use PNG. If you only need a single transparent colour, then you can specify this in the <colorkey> tag, so any image will be fine. It is suggested that you use PNG and JPG as much as possible. Note that once the images are injected into Textures.xbt, they are not stored as JPG or PNG – rather they are stored in a xbox native format for faster loading. The size of the images (in kb) is therefore not as important as the size of the images in pixels – so feel free to store them in a lossless (eg PNG) manner if you wish.
If you wish to use full 8 bit transparency, then use PNG. If you only need a single transparent colour, then you can specify this in the <colorkey> tag, so any image will be fine. It is suggested that you use PNG and JPG as much as possible. Note that once the images are injected into Textures.xbt, they are not stored as JPG or PNG – rather they are stored in a xbox native format for faster loading. The size of the images (in kb) is therefore not as important as the size of the images in pixels – so feel free to store them in a lossless (eg PNG) manner if you wish.

Revision as of 19:04, 12 February 2012

The MultiImage control is used for displaying a slideshow of images from a folder in XBMC. You can choose the position and size of the slideshow, as well as timing information.

Example

<control type="multiimage" id="1">
      <description>My first slideshow control</description>
      <posx>80</posx>
      <posy>60</posy>
      <width>250</width>
      <height>200</height>
      <visible>true</visible>
      <imagepath>myimagepath</imagepath>
      <info></info>
      <timeperimage>5000</timeperimage>
      <fadetime>2000</fadetime>
      <pauseatend>10000</pauseatend>
      <randomize>true</randomize>
      <loop>no</loop>
      <aspectratio>stretch</aspectratio>
</control>

Image Size and Type Restrictions

For the <texture> tags, and for all <texture> tags in other controls, there is a small set of rules that you should follow if at all possible:

Formats

If you wish to use full 8 bit transparency, then use PNG. If you only need a single transparent colour, then you can specify this in the <colorkey> tag, so any image will be fine. It is suggested that you use PNG and JPG as much as possible. Note that once the images are injected into Textures.xbt, they are not stored as JPG or PNG – rather they are stored in a xbox native format for faster loading. The size of the images (in kb) is therefore not as important as the size of the images in pixels – so feel free to store them in a lossless (eg PNG) manner if you wish.

The only exception to this is if you require an animated texture. In this case, we only support animated GIF. There are also SOME animated gifs that may not work. Use ImageReady CS and make sure you set the gif-anim to “restore to background” and they should work fine.

Available Tags and Attributes

In addition to the default control tags, the following tags are available. Note that each tag is lower case only. This is important, as xml tags are case-sensitive.

imagepath Specifies the path containing the images to use for the slideshow. XBMC will first look inside the compressed Textures.xbt file for images, and then will look in the actual folder. The path is relative to the media/ folder if it is not specified completely. It must be a local path (ie on the local harddisk) for speed purposes.
info Specifies the information that this image control is presenting. XBMC will select the texture to use based on this tag. See here for more information.
timeperimage Time in milliseconds that an image is shown for.
fadetime Time in milliseconds to fade between images.
pauseatend Time in milliseconds to pause (in addition to <timeperimage>) on the last image at the end of a complete cycle through the images. Only useful if <loop> is set to yes.
loop If set to no, the last image will display indefinitely. Setting it to yes will loop around once they reach the last image. Defaults to yes.
aspectratio This specifies how the image will be drawn inside the box defined by <width> and <height>. See here for more info