NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 18 19 20 21 22 … 93 Next »
Resource management

 
  • 0 Vote(s) - 0 Average
Resource management
InVermont
Offline

Member

Posts: 157
Threads: 10
Joined: Mar 2007
#1
2010-08-12, 04:08 PM
When I add a bitmap to a UiList.ListItem, does it manage the bitmap after that?
So if I use uiList.SetListObjects(list) again to change the contents of base.uiList
, do I need to clean up the old list?

How about a UiStatic? If I change the image like

// myImage is a UiStatic, previously created with another image
Hashtable h = new Hashtable();
h.Add("@image", MyNewBitmapImage );
myImage = new UiStatic("myImage", h, mySkinHelper);

is the old bitmap cleaned up?
Thanks
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#2
2010-08-12, 04:20 PM
Quote:When I add a bitmap to a UiList.ListItem, does it manage the bitmap after that?
So if I use uiList.SetListObjects(list) again to change the contents of base.uiList
, do I need to clean up the old list?
If you add any resources to a UiList.ListItem then require Disposing, then you'd have to call Dispose() on it yourself when you know you no longer need them.

If you're finished with hte UiList, and wont be using it again, you should call uiList.Dispose();

Quote:How about a UiStatic? If I change the image like

// myImage is a UiStatic, previously created with another image
Hashtable h = new Hashtable();
h.Add("@image", MyNewBitmapImage );
myImage = new UiStatic("myImage", h, mySkinHelper);
Usually with a UiStatic to update the image you'd just do myUiStatic.Args = newHashtableArgs; and it'll redraw itself. If wanted to free the resources used by a UiStatic, like you're showing it in a popup, and that popup is about to be destroyed, then you should call myUiStatic.Dispose()
InVermont
Offline

Member

Posts: 157
Threads: 10
Joined: Mar 2007
#3
2010-08-12, 05:10 PM
I tried
Hashtable h = new Hashtable();
h.Add("@image", MyNewBitmapImage );
myImage.Args = h;
but it didn't change the image. using
myImage = new UiStatic("myImage", h, mySkinHelper);
does cause the image to change.

will investigate further.
Thanks
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#4
2010-08-12, 05:21 PM
You might need to have a string or a date or sometyhing in the hashtable to. ie, something that causes ToString() to return a different value than previously.
InVermont
Offline

Member

Posts: 157
Threads: 10
Joined: Mar 2007
#5
2010-08-12, 06:12 PM
Worked like a charm.
Again, thanks a lot.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  What SCM (Source Control Management) system do you use? JavaWiz 3 2,034 2008-08-19, 07:28 PM
Last Post: Manderson
  More On Memory Management Ommina 2 1,691 2008-01-09, 06:54 AM
Last Post: Ommina
  Memory management - controls and popups JavaWiz 2 1,915 2008-01-06, 02:48 AM
Last Post: JavaWiz
  Power Management Plugin colin 12 6,221 2005-09-30, 02:55 AM
Last Post: colin
  Conflict Management KingArgyle 0 1,523 2004-12-10, 02:30 PM
Last Post: KingArgyle

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode