You Are Here:

Community: Developer Discussion Boards

#1 Old How to unload or close images? - 2008-12-11, 17:47

Join Date: Oct 2006
Posts: 30
Location: Austria - Vienna
andipro
Offline
Registered User
After loading and using images, sometimes it will good (spare memory) to unload or close images. I only found the possibility to clear an image, but not more. Closing or deleting dont work thank you for your tip
Reply With Quote

#2 Old Re: How to unload or close images? - 2008-12-11, 17:53

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Have you tried something like this:
Code:
#Let's assume img is your image object

del img
#This deletes it
Reply With Quote

#3 Old Thumbs up Re: How to unload or close images? - 2008-12-11, 18:00

Join Date: Oct 2006
Posts: 30
Location: Austria - Vienna
andipro
Offline
Registered User
I my god - so simple!? What a shame! Thank you...
(I've tried img.delete() )
Reply With Quote

#4 Old Re: How to unload or close images? - 2008-12-11, 18:56

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
Quote:
Originally Posted by andipro View Post
I my god - so simple!? What a shame! Thank you...
(I've tried img.delete() )
del is a general Python statement which removes a reference pointing to an object. When the last reference to an object is deleted, the object may be garbage collected. Note that there may be other references pointing to the image object. Only after all of the references are deleted, memory may be freed:

Code:
img = graphics.Image.open("E:\\Images\\myimage.jpg")

img2 = img   # img and img2 reference the same image. There are no two Image() objects.

del img      # The Image() object still stays, because img2 points to it.

del img2     # Now the memory of the Image() object may be reclaimed.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect rgb values for jpg images on S40 3rd ed bjudfar Mobile Java Media (Graphics & Sounds) 8 2007-05-29 17:34
How to use code to get images from webCam??? DancingWave Browsing and Mark-ups 0 2006-04-10 10:06
How can I unload the images I finish using them during run time in mobiles? bb_sathya Mobile Java General 23 2005-12-13 10:07
Help with creating Images..Pls rj_cybersilver Mobile Java Media (Graphics & Sounds) 0 2005-03-02 02:58
Problem with PNG Images cyphre666 Mobile Java Media (Graphics & Sounds) 4 2003-12-12 19:20

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia