UltraFastImage: Dynamically generated alpha/masks?

Blitz3D Forums/Blitz3D Userlibs/UltraFastImage: Dynamically generated alpha/masks?

Danny(Posted 2008) [#1]
Is it possible somehow using the Fastimage dll to use alpha or masking features with "self-created" or dynamically-generated textures? (eg: black = transparent)

I've seen the question pop up before but never seen a straight solution.
I can't possibly go through each pixel converting them from 24 to 32 bit. ReadPixelFast and WritePixelFast simply ain't 'fast enough..

SetBlend FI_MASKBLEND also only seems to work on 'loaded' textures and not on created ones..

I was thinking that maybe the 'SetCustomBlend' function could solve this. If not in a single pass, perhaps in multiple passes??
For example, where one operation removes the underlying background before pasting the (semi-)masked texture. If that makes any sense..

I've tried playing with 'SetCustomBlend' but I simply haven't got a clue how it works or what I'm doing really :(

Anyone got any ideas or solutions?

Danny


_33(Posted 2008) [#2]
You're better off using blend modes (SetCustomBlend) for transparency, or if you want you can make your own alpha channel transparent using GIMP and applying an alpha channel like you want there and save as PNG.

Side note: When you copy from image buffer to texture buffer, you loose the alpha channel.

Also this DLL might be helpful for various things: http://www.blitzbasic.com/Community/posts.php?topic=75711


Danny(Posted 2008) [#3]
Thanks 33, but i'm looking for something that works on dynamically created textures at runtime, not anything disk-based... Hence my problem ;)