[Lazarus] Background colours etc.

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Sat Mar 3 07:47:29 CET 2012


On Fri, Mar 2, 2012 at 11:46 PM, Mark Morgan Lloyd
<markMLl.lazarus at telemetry.co.uk> wrote:
> OK, but are you saying that I've got to start filling areas at runtime or
> drawing vectors? I was hoping to be able to use some "fire and forget"
> bitmaps, possibly with one colour being reserved for
> background/transparency.

transparency is not supported currently in TWinControl descents.
TWinControl.setShape(Bitmap) is the closest to what you want, but a
lot of interfaces don't support it, and in general it is not a very
portable method. If you really want that and don't want to use method
1 or method 2, then you can write a TGraphicControl descendent and
paint there only your star without its background. By not painting the
background it will be transparent. It will not be able to receive
keyboard events as it is not a TWinControl. I don't know a ready
component which will do that you might need to write one.

And about method 2, it is not vectorial drawing. It is a region shape
setting. You can see an example here:

http://wiki.lazarus.freepascal.org/LazEyes

It allows for non-rectangular windows and controls. If all your starts
have the same size you can set the shape once and forget. If they have
different sizes you will need to reshape for each star size.

-- 
Felipe Monteiro de Carvalho




More information about the Lazarus mailing list