You Are Here:

Community: Developer Discussion Boards

#1 Old svg mask - 2008-03-29, 13:54

Join Date: Mar 2008
Posts: 57
nokia_e70
Offline
Regular Contributor
Hi

Anybody with an idea on how to get the mask for blitting an svg icon? It's supposed to be antialiased, so the mask can't be 1-bit like in the automask function. I'm using Image.from_icon to load the icon, but the Image object doesn't seem to provide the masks of transparent objects (be it icons, png files...).

EDIT: Here's what I came up with myself: load the icon to a big bitmap (a few times bigger than the size at which it will be used), convert it to a 1-bit image, scale it down (with antialiasing) to the target icon size, and save as an 8-bit mask. Then scale the original icon to the target size and blit to the canvas using that mask.

The only problem now (with the theory) is that the pixels on the edge of the icon will be shifted towards white (as they get melted to the white background when scaled). I'm gonna try that tommorow to see if it's viewable (or maybe even has some interesting glowing effect).
Last edited by nokia_e70 : 2008-03-29 at 22:06.
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
svg icon mask s4028469 Symbian Media (Graphics & Sounds) 16 2007-09-26 04:55
TinyLine SVG Player and SDK 1.8.2 released. girow Mobile Java Tools & SDKs 0 2005-03-10 08:31
TinyLine SVG Player and SDK 1.8.2 released. girow Mobile Java General 0 2005-03-10 08:30
TinyLine SVG Minute Toolkit: Optimizing SVG for J2ME girow Mobile Java Media (Graphics & Sounds) 0 2003-05-05 19:44
TinyLine SVG Minute Toolkit for J2ME: version 1.4 released girow Mobile Java General 0 2003-05-05 17:25

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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d81449X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZpythonQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZuserE5ftagQSxpythonX qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ