Background loading
#1
I don't get the background loading for images.

From the online manual
Quote:Background loading
Images are loaded one at a time in a background worker thread and are shown as soon as xbmc processes them. Has the benefit that images can be loaded into memory before they're visible, resulting in smoother scrolling and transitions.
But where to write which images to load in the background?

My code for showing a fanart background in the videolibrary look like this
Code:
<control type="largeimage">
<posx>0</posx>
<posy>0</posy>
<width>720</width>
<height>576</height>
<visible>!IsEmpty(listitem.property(fanart_image))</visible>
<background>true</background>
<texture>$INFO[listitem.property(fanart_image)]</texture>
</control>
Reply
#2
<texture background="true">$INFO[listitem.property(fanart_image)]</texture>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
thanks ronie! you are always helpful! Big Grin
but I can't see no difference in loading speed when I changed the code.

say I have three items in my list.
first time i load a background (1) it goes slow. I load another background (2) and go back to previous (1) bang! shows on screen really fast.
I go back to 2 (fast) and 3 (slow) then back to 2 and 1, but now 1 is slow again.
So it only keeps the previous loaded backgrounds in memory, right?
But if I wanna load a background in advance?
Say I am at position 2 in my list and wanna load fanart for item 1 and item 3.

say like
Code:
<texture background="true">$INFO[listitem.property(fanart_image)+1]</texture>
<texture background="true">$INFO[listitem.property(fanart_image)-1]</texture>
if you know how I mean...
Reply
#4
It's not the speed of loading that is increased. The fact that it's loading in the background means it's not blocking anything else, which means that the UI will stay responsive
Reply
#5
also check this thread for more info:
http://forum.xbmc.org/showthread.php?tid=51814
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#6
ah ok, not blocking anything else from loading, ok I see.
so it's the <preloaditems> I should use?

Code:
<preloaditems>2</preloaditems>
loads the next and previous items?
and it has to be inside the list-tag
Code:
<control type="wraplist">
?
Reply
#7
Father Parsley Wrote:ah ok, not blocking anything else from loading, ok I see.
so it's the <preloaditems> I should use?

Code:
<preloaditems>2</preloaditems>
loads the next and previous items?
and it has to be inside the list-tag
Code:
<control type="wraplist">
?

depends on what you're trying to do.
for just displaying fanart images, the code i posted above would be enough.

the <preload> option can be used in panels, wraplistst, etc...
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#8
i have a list in my videolibrary with all my movies.
the selected movies fanart shows as a backdrop.
i want the fanart image for the next and the previous item to be stored in the memory, so the image shows right away.

and this will do the trick?
Code:
<control type="wraplist">
<preloaditems>2</preloaditems>
</control>
Reply
#9
Not unless the fanart image is being loaded from the container itself.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#10
So how should I do? I still don't get it.
Surely there must be some code to just copy-paste.
Reply
#11
alright, let's try again...
as mentioned above, the code you need for background loading of fanart:
Code:
<control type="largeimage">
    <posx>0</posx>
    <posy>0</posy>
    <width>720</width>
    <height>576</height>
    <texture background="true">$INFO[listitem.property(fanart_image)]</texture>
    <visible>!IsEmpty(listitem.property(fanart_image))</visible>
</control>

the <preloaditems> is mostly used in wraplists/panels/etc.. for preloading thumbs.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#12
whats the difference between
<control type="largeimage">
and
<control type="image">
?
http://www.xbmcnerds.com - german xbmc community
Reply
#13
donabi Wrote:whats the difference between
<control type="largeimage">
and
<control type="image">
?

http://wiki.xbmc.org/?title=Large_Image_Control
http://wiki.xbmc.org/?title=Image_Control
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#14
thx.

and what is the benefit of it?
there must be a good reason to have two different imagecontrols...
http://www.xbmcnerds.com - german xbmc community
Reply
#15
Zero benefit. It's been superseded by background="true". It just auto-translates that on load.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Background loading0