home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
How to create own (dynamic) thumbnailpanel?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Inker" data-source="post: 163565" data-attributes="member: 10541"><p>Well, if you instanciate them within a Method (the controls) then that reference is only existing until the method returns.</p><p></p><p>But, since you add them to the Childrens node (which is a List<GuiControls> I think) you can access them from there like so Children[n] where n is the index number of the control which you wish to receive.</p><p></p><p>Be aware that this List also contains all the other controls on your page, including the ones imported from various common xmls. Because of this, I would suggest creating your own List<GuiImage> as a class member (declare outside of a method) and then add them there. This way you can get quick access.</p><p></p><p>[CODE]List<GuiImage> myThumbnails = null;</p><p></p><p>private void Foo()</p><p>{</p><p> if(myThumbnails == null) myThumbnails = new List<GuiImage>();</p><p> GuiImage newImage = new GuiImage(blabla here);</p><p> myThumbnails.Add(newImage);</p><p> Childen.Add(newImage);</p><p>}</p><p></p><p>private void Fooo()</p><p>{</p><p> GuiImage existingImage = myThumbnails[0];</p><p> // do somethign with the image here, like set a new filename</p><p>}[/CODE]</p><p></p><p>I really suggest you read up on OO and .NET in general <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Inker, post: 163565, member: 10541"] Well, if you instanciate them within a Method (the controls) then that reference is only existing until the method returns. But, since you add them to the Childrens node (which is a List<GuiControls> I think) you can access them from there like so Children[n] where n is the index number of the control which you wish to receive. Be aware that this List also contains all the other controls on your page, including the ones imported from various common xmls. Because of this, I would suggest creating your own List<GuiImage> as a class member (declare outside of a method) and then add them there. This way you can get quick access. [CODE]List<GuiImage> myThumbnails = null; private void Foo() { if(myThumbnails == null) myThumbnails = new List<GuiImage>(); GuiImage newImage = new GuiImage(blabla here); myThumbnails.Add(newImage); Childen.Add(newImage); } private void Fooo() { GuiImage existingImage = myThumbnails[0]; // do somethign with the image here, like set a new filename }[/CODE] I really suggest you read up on OO and .NET in general :-) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
How to create own (dynamic) thumbnailpanel?
Contact us
RSS
Top
Bottom