bitmap transparency setting

For general discussion related FlowStone
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

bitmap transparency setting

Post by tester »

Is there a way to regulate transparency of loaded bitmap? Via ruby perhaps?

Or going a little bit further - how to perform math (old paintshop-like style: average, multiply, difference, and, or, etc.) operations on same sized bitmaps?

Basically I'd like to make something that operates on multiple bitmaps at the same time, with simple on/off switching and reloading what I want. Yet another mad science experiment. :-)
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: bitmap transparency setting

Post by Exo »

The only feasible way to modify bitmaps is via the DLL component. Ruby would be way to slow.

There us an example Here of modifying the transparency if a bitmap.

It is all pretty tricky though because you have to work directly with a BYTE array.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Post by tester »

Maybe it will be not that bad? I mean - It's going to be rater set-once situation, depending on how many slots are in use, plus - graphics will be rather under 1000px sizes. By slow you mean seconds, tens of seconds, minutes?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: bitmap transparency setting

Post by Exo »

Actually it is not even possible in Ruby because there is no Bitmap class, that is the reason it is passed from outside only. The bitmap that is passed cannot be modified.

You could try using the primitive "getPixel" and "setPixel" but this will be quite slow maybe it will be ok but the UI will become unresponsive if it takes to long.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Post by tester »

I see in manual, that there is transparency setting for bitmap in ruby?

http://www.dsprobotics.com/Files/V3/User%20Guide.pdf
site: 167

Manipulating transparency should do the "average" function, and maybe I don't need anything more.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Exo
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK
Contact:

Re: bitmap transparency setting

Post by Exo »

I never noticed that, that should work fine then for transparency and should be fast too because it is a built in.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Post by tester »

Some other functions/adjustements can be probably done by backgrounding or foregrounding white/black layer.
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Post by tester »

Coult you post an example on how to use it with transparency?

But also, so that the bitmap follows area size (is rescaled to fit the area as you rescale the gui by dragging it).
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Post by tester »

I think I found it.
Attachments
bitmap-alpha.fsm
(3.83 KiB) Downloaded 1111 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Post by tester »

...and how/where to include this?

Bitmap Rendering Options
If you are drawing a bitmap into a rectangle that is a different size then you can choose how to render
that bitmap by setting the interpolation mode. This is done using the following View method:
setInterpolationMode
mode
This takes either an integer (0-7) or one of the following strings:
"low","high","bilinear","bicubic","nearest","hqbilinear","hqbicubic"
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
Post Reply