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
12 posts
• Page 1 of 2 • 1, 2
bitmap transparency setting
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.
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.
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
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.
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.
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: bitmap transparency setting
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.
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
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.
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.
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: bitmap transparency setting
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.
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.
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
I never noticed that, that should work fine then for transparency and should be fast too because it is a built in.
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: bitmap transparency setting
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.
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
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).
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.
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
I think I found it.
- Attachments
-
- bitmap-alpha.fsm
- (3.83 KiB) Downloaded 963 times
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
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
...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.
Feel free to donate. Thank you for your contribution.
- tester
- Posts: 1786
- Joined: Wed Jan 18, 2012 10:52 pm
- Location: Poland, internet
12 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 76 guests