[Lazarus] Background colours etc.
Mark Morgan Lloyd
markMLl.lazarus at telemetry.co.uk
Sat Mar 3 09:27:16 CET 2012
Felipe Monteiro de Carvalho wrote:
> 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.
Thanks, noted.
For something which is known not to have "holes", is there an easy way
of doing a flood fill of the background colour to the TImageList?
--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk
[Opinions above are the author's, not those of his employers or colleagues]
More information about the Lazarus
mailing list