On 11-Jan-07, at 12:53 AM, Mark Levinson wrote:
On Jan 9, 2007, at 1:54 AM, Frank Condello wrote:
...have tried to eliminate these using a mask, but to date no
success.
Picture.Transparent is 1 bit transparency, hence the halo...
i.e on-or-off rather than degrees of transparency?
Right...
The trick is to only draw the text into the mask - e.g. Fill the
mask with white, then draw black text into the mask, then fill the
RGB picture with black (or whatever colour you want the final text
to be).
Yes, it works!! (see code below) Now if I just understood
why....is the explanation somewhere in the docs for Picture?
The mask uses 256 levels of transparency (where black is solid, white
is fully transparent, and greys are somewhere in between) so when you
draw black antialiased text to a white mask you're simply defining
how transparent each pixel should be. The colour of those pixels is
controlled by the RGB portion of the picture.
Will this also eliminate similar halos around imported images? I
have also noticed these halos around TIFF's or PNG's imported into
a Picture and then drawn into another picture using g.drawPicture
(theImported, 0, 0).
Yes, as long as you have a smooth greyscale mask and the images are
properly composed. The TIFF and PNG formats support alpha channels
(basically inverted masks) but RB doesn't actually load alpha
channels, so you either have to load masks separately or use custom
image loaders that can deal with alphas. This is one of the main
reasons I created the PNG Utilities plugin: <http://
developer.chaoticbox.com/realbasic.php>
Frank.
<http://developer.chaoticbox.com/>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>