FLTK logo

Re: [fltk.general] Re: Rounded Frames/Draw Rounded Rectangle

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: Rounded Frames/Draw Rounded Rectangle Albrecht Schlosser Jul 27, 2021  
 
On 7/27/21 10:46 PM Ian MacArthur wrote:
On 27 Jul 2021, at 21:27, Webb Hinton wrote:
Or consider the following UI designs:

Rounded avatar pictures:
<roundedavatars.PNG>

Rounded images in a grid:
<masonary-images.jpg>

As far as I can tell there's no way to clip to rounded edges in FLTK in a way that would (with reasonable effort) create such effects.

I'm sure you could find some way to edit the pixel data of the image themselves to get these rounded edges, but that sounds very complicated...

You can of course create those effects in fltk, but there are no “default” widgets that will do that.
Typically, you’d do this by rendering to a (rectangular) offscreen surface, then mask that with a “barn door” (usually only two states, transparent and opaque) alpha channel mask to show the appropriate final shape. You need to derive your own widget for this though, from Fl_Box say, as it is not an “out of the box” feature.

You could also draw the image first in a rectangular shape and the rounded corners (in the background color) "over" the image.

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/f0d23c35-0875-3b13-df24-1ffdc4d38928%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.