Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

bitmap transparency setting

For general discussion related FlowStone

bitmap transparency setting

Postby tester » Sat Sep 20, 2014 11:48 am

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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Postby Exo » Sat Sep 20, 2014 2:53 pm

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.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: bitmap transparency setting

Postby tester » Sat Sep 20, 2014 2:58 pm

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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Postby Exo » Sat Sep 20, 2014 3:49 pm

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.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: bitmap transparency setting

Postby tester » Sat Sep 20, 2014 4:23 pm

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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: bitmap transparency setting

Postby Exo » Sat Sep 20, 2014 4:31 pm

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.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: bitmap transparency setting

Postby tester » Sat Sep 20, 2014 4:33 pm

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

Postby tester » Sat Sep 20, 2014 5:35 pm

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

Postby tester » Sun Sep 21, 2014 12:07 pm

I think I found it.
Attachments
bitmap-alpha.fsm
(3.83 KiB) Downloaded 965 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

Postby tester » Sun Sep 21, 2014 12:30 pm

...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.
tester
 
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Next

Return to General

Who is online

Users browsing this forum: No registered users and 62 guests