Categories: Python | S60 | Code Examples | How To
This page was last modified 12:37, 19 April 2008.
How to calculates the transparency for icons
From Forum Nokia Wiki
Here is a piece of source that calculates the transparency for icons in Python
## This code Calculates the mask for the list icon. # Here is the list of parameters and function return values. # All white point are transformed to transparent. # Parameter : self The object pointer. # Parameter : aImg An image object. # Returns : Image mask object. def _autoMask( self, aImg ): width, height = aImg.size mask = Image.new( aImg.size, '1' ) tran = (255,255,255) for y in range( height ): line = aImg.getpixel( [( x, y ) for x in range( width )] ) for x in range( width ): if line[x] == tran: mask.point( ( x, y ), 0 ) ## Icon mask for dealing with transparency self._iDefaultIconMask = mask
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Theme Studio icons problem | floo_user | Symbian Tools & SDKs | 3 | 2004-04-12 01:56 |
| mutable transparent image | bh213 | Mobile Java General | 2 | 2002-12-14 13:56 |
| Theme Studio icons problem | floo_user | Mobile Java Tools & SDKs | 1 | 2004-01-26 21:42 |
| icon | letiziad | General Symbian C++ | 2 | 2006-09-22 16:08 |
| How to access pixel array of image captured by viewfinder | yqmtooblue | Python | 1 | 2007-11-06 20:48 |
