On 17.05.2011, at 16:49, Francesco wrote:

> Hi,
> I am trying to modify the fl_dial class to look something like this:
> http://soundsandgear.com/wp-content/uploads/2009/07/massive.jpg
> 
> I have created the images i need, but i can't find a way to show them 
> "nicely". Using fltk image classes I have some problems:
> 1) when i scale them they look bad.

Yes. FLTK uses a very quick but simple scaling algorithm. You can create your 
widget image in multiple sizes and use the one that is closest.

> 2) i can't rotate them

Yes, again, bitmaps are difficult and slow to rotate. They always lose some of 
the quality. FLTK does not offer image rotation.

> 3) fltk doesn't seem to handle transparency correctly (with .xpm alpha works, 
> but it's only a 1 bit alpha)

FLTK 1.3.0 should handle alpha channels in PNG images and RGBA pixel maps 
correctly.

> 4) it crashes if i try to load a too big png (eg. 500*500 px)

It did that in older versions of FLTK. Please use 1.3.0.

> I tried doing some test with opengl (as the documentation says it's possible 
> to use opengl to draw inside a widget) but the opengl image just flashes and 
> disappears suddenly. Is it actually possible to draw a widget with openGL? 
> Can someone give me a small example?

OpenGL example programs are in the 'test' directory of the official FLTK 
distro. There are not OpenGL widgets yet, but it is possible and requires only 
a little trick. After that, *all* widgets in that window need to be drawn with 
OpenGL though. The next version of FLTK will support OpenGL drawing for widgets.

> I also tried using another library for image processing (cImg), but they use 
> a different image representation, so i have to convert it pixel by pixel and 
> it's too slow.

I can't help you there. I don't know that library. RGB and RGBA which FLTK uses 
are pretty common though.

> Tl;dr: HOW DO I GO ABOUT MAKING A COOL LOOKING WIDGET? (antialiased, scales 
> properly (interpolation))

Create it predrawn as image maps or draw them in OpenGL. Where available, FLTK 
draws antialiased as well (OS X, for example).

> I would also like to know, if my widget "changes shape" is there a way in his 
> draw() method to first redraw the background and then draw the widget itself? 
> otherwise it would leave a 'trail'...

Yes. Override your widget s draw() function. In there, set the clipping to your 
widget size. Then call parent()->draw(). Then draw you widget. You should use 
double buffered windows, or you will see a blinking widget.

> please someone help me!

We do what we can ;-)
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to