converting Vectors to Bitmaps with mask
Alejandro Tejada
capellan2000 at yahoo.com
Sun Jun 8 11:07:01 EDT 2003
on Tue Jun 3 14:01:01 2003
Chipp Walters wrote:
>Here's how I would approach it.[snip]
>1) Create your vector graphic
>2) Convert it to a bitmap with import snapshot
>the rect of the graphic (be sure to use the window
ID)
I used the code in the Ken Ray's website to export
a card image without using a screenshot...
http://www.sonsothunder.com/devres/metacard/tips/imag007.htm
I comment these 2 lines of this code:
-- do "export" && pImageType && "to file pExportPath"
-- delete last image
to left the image in the card but it gets corrupted
when I click on it.
>3) Re-render your vector graphic so that it is
>black on white, thus creating a mask
Actually, Ken has a code to convert a single color
to transparent:
http://www.sonsothunder.com/devres/metacard/tips/imag004.htm
but I cannot use it on the image,
because It gets corrupted everytime...
[snip]
>If you are using anti-aliased graphics
>(such as smoothed screenfonts), this somewhat
changes,
>but is still possible. Basically you need to only
>use the alphamasks and apply them to solid color
>bitmaps.
I was calculating that to create an antialiased
bitmap,
1) draw the graphics at double size
2) take a screenshot or save an image of it
3) resize the image to half his size.
4) the engine interpolates the pixels creating
an antialised image.
Could this always works as expected?
Alejandro
=====
Useful sites:
http://www.sonsothunder.com/devres/metacard/tips/ and /revolution/tips/
http://lists.runrev.com/pipermail/metacard/ and /use-revolution/
http://wiki.macitworks.com/revdocs
http://www.google.com/advanced_search?q=site:lists.runrev.com
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
More information about the use-livecode
mailing list