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 knobs strange scaling/fuzziness
5 posts
• Page 1 of 1
Bitmap knobs strange scaling/fuzziness
Hi.
Hoping one of you gurus can help.
Just trying out Flowstone - downloaded it yesterday. I like the potential I'm seeing so far, and was close to buying it, but having some bother with bitmap-blitted knobs.
I have 31 of, 64x64 knob pics made in a vertically joined, rotating, sequence made with Knobman. They look fine in gfx package, and fine if I draw the whole thing statically in Flowstone (i.e. the long strip).
when I load them in as a bitmap, I then use the following to attempt to make a rotating knob:
knobNumPics = 31
knobHeight = ( (@picKnob.height/knobNumPics)).to_int
knobHeight = 64
cell = ((knobNumPics - 0.45 ) * @meterVal ).to_int
srcRect = [0,bmpVertStart,64, 64 ]
output 1, cell
v.drawBitmapSection @picKnob, srcRect,[0,0, 20, 20 ]
This works, in that a fuzzy version of the knob is drawn, and does rotate as expected, but (seemingly) due to the stupid grid-based scaling of srcRect/drawBitmapSection compared with drawBitmap, the pixel-to-pixel mapping I was expecting is lost.
Is this just a (severe) limitation or is there something I've misunderstood? (hoping the latter).
I guess I could load in 31 separate bitmaps (groan) and make it work that way.
What is it with this grid-based scaling thing and why is it there? Just seems silly when dealing with bitmaps.
Many thanks in advance
n.
Hoping one of you gurus can help.
Just trying out Flowstone - downloaded it yesterday. I like the potential I'm seeing so far, and was close to buying it, but having some bother with bitmap-blitted knobs.
I have 31 of, 64x64 knob pics made in a vertically joined, rotating, sequence made with Knobman. They look fine in gfx package, and fine if I draw the whole thing statically in Flowstone (i.e. the long strip).
when I load them in as a bitmap, I then use the following to attempt to make a rotating knob:
knobNumPics = 31
knobHeight = ( (@picKnob.height/knobNumPics)).to_int
knobHeight = 64
cell = ((knobNumPics - 0.45 ) * @meterVal ).to_int
srcRect = [0,bmpVertStart,64, 64 ]
output 1, cell
v.drawBitmapSection @picKnob, srcRect,[0,0, 20, 20 ]
This works, in that a fuzzy version of the knob is drawn, and does rotate as expected, but (seemingly) due to the stupid grid-based scaling of srcRect/drawBitmapSection compared with drawBitmap, the pixel-to-pixel mapping I was expecting is lost.
Is this just a (severe) limitation or is there something I've misunderstood? (hoping the latter).
I guess I could load in 31 separate bitmaps (groan) and make it work that way.
What is it with this grid-based scaling thing and why is it there? Just seems silly when dealing with bitmaps.
Many thanks in advance
n.
- natbuk
- Posts: 3
- Joined: Wed Nov 12, 2014 1:02 am
Re: Bitmap knobs strange scaling/fuzziness
Fuzziness may happen because of interpolation, if the bitmap is not perfectly aligned with screen pixels. Normally Grid in FS is 8*8 pixels. Check if the X and Y offset of the bitmap is integer when you multiply it by 8.
- KG_is_back
- Posts: 1196
- Joined: Tue Oct 22, 2013 5:43 pm
- Location: Slovakia
Re: Bitmap knobs strange scaling/fuzziness
Hi natbuk, welcome!
Try scaling up in multiples of 8, for example 16 or 24.
Also the grid pixel size can be changed in the options if you like, although I have never felt a need to do that.
Try scaling up in multiples of 8, for example 16 or 24.
Also the grid pixel size can be changed in the options if you like, although I have never felt a need to do that.
- Exo
- Posts: 426
- Joined: Wed Aug 04, 2010 8:58 pm
- Location: UK
Re: Bitmap knobs strange scaling/fuzziness
natbuk wrote:Hi.
Hoping one of you gurus can help.
Just trying out Flowstone - downloaded it yesterday. I like the potential I'm seeing so far, and was close to buying it, but having some bother with bitmap-blitted knobs.
I have 31 of, 64x64 knob pics made in a vertically joined, rotating, sequence made with Knobman. They look fine in gfx package, and fine if I draw the whole thing statically in Flowstone (i.e. the long strip).
when I load them in as a bitmap, I then use the following to attempt to make a rotating knob:
knobNumPics = 31
knobHeight = ( (@picKnob.height/knobNumPics)).to_int
knobHeight = 64
cell = ((knobNumPics - 0.45 ) * @meterVal ).to_int
srcRect = [0,bmpVertStart,64, 64 ]
output 1, cell
v.drawBitmapSection @picKnob, srcRect,[0,0, 20, 20 ]
This works, in that a fuzzy version of the knob is drawn, and does rotate as expected, but (seemingly) due to the stupid grid-based scaling of srcRect/drawBitmapSection compared with drawBitmap, the pixel-to-pixel mapping I was expecting is lost.
Is this just a (severe) limitation or is there something I've misunderstood? (hoping the latter).
I guess I could load in 31 separate bitmaps (groan) and make it work that way.
What is it with this grid-based scaling thing and why is it there? Just seems silly when dealing with bitmaps.
Many thanks in advance
n.
Just a quick visit, because I don't have much time. There are some issues with the code you posted.
- Code: Select all
knobHeight = ( (@picKnob.height/knobNumPics)).to_int
knobHeight = 64
- Code: Select all
cell = ((knobNumPics - 0.45 ) * @meterVal ).to_int
- Code: Select all
v.drawBitmapSection @picKnob, srcRect,[0,0, 20, 20 ]
Is this really what you wanted?
In general, to convert to pixels, if you prefer calculating them instead of grid units, there are the view properties 'gridStep' and 'defaultGridStep'. The first one returns the current grid step (= grid step value with respect to the current zoom level), the second one the grid step at standard zoom (which is 8 pixels, if you didn't change it)
Also, the bitmap object alternatively offers size values in pixels. Instead of .width, .height just use .widthPixels, .heightPixels.
Converting pixel to grid (ignoring zoom):
bitmap.widthPixels / v.defaultGridStep
Converting grid to pixel(ignoring zoom):
bitmap.width * v.defaultGridStep
Tell me if something's unclear.
"There lies the dog buried" (German saying translated literally)
- tulamide
- Posts: 2714
- Joined: Sat Jun 21, 2014 2:48 pm
- Location: Germany
Re: Bitmap knobs strange scaling/fuzziness
i've tested the knobs with jknobmaker once, works all fine, you also need to take care of the startangles, watch this thread..
viewtopic.php?f=3&t=1129
viewtopic.php?f=3&t=1129
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 55 guests