Board index » delphi » Semi-transparent filled selection rectangle?

Semi-transparent filled selection rectangle?

Hi,

Is it possible somehow to make a semi-transparent filled selection
rectangle?
I want to use this during runtime to select hotspot areas on a picture.
It would also be great if I could use different semi-transparent colors of
the rectangle.
The rectangle must of course be movable and resizable during runtime.

I really need help with this!

Thanks,
PM

 

Re:Semi-transparent filled selection rectangle?


Hi PM,

The simplest solution would be with Canvas.FillRect.

The Canvas.Brush.Style or Canvas.Brush.Bitmap can supply different effects.

Another solution would be to directly alter the pixels.

Or CopyRect to a temporary canvas, apply different effects, then copyRect
back.

Plenty of info & demos at
http://www.efg2.com/Lab/

Nic Roche
Net Extra
www.extra.net.au

Quote
PM <we...@hem.passagen.se> wrote in message

news:87e4u8$5973@bornews.borland.com...
Quote
> Hi,

> Is it possible somehow to make a semi-transparent filled selection
> rectangle?
> I want to use this during runtime to select hotspot areas on a picture.
> It would also be great if I could use different semi-transparent colors of
> the rectangle.
> The rectangle must of course be movable and resizable during runtime.

> I really need help with this!

> Thanks,
> PM

Re:Semi-transparent filled selection rectangle?


Paul van Dinther has a couple of freeware components that might do the
trick.  One is called TRectBox, the other is called TTransCanvas.

The TransCanvas is very interesting, I think it does exactly what you're
looking for - except for the moving and sizing.  TRectBox has the moving and
resizing capability, between the two maybe there's an easy solution.  Source
included.  Find these at:

http://www.geocities.com/Athens/3683/componentsdesc.htm

--
Harm

Omaha NE

http://www.users.uswest.net/~sharman1/

 'sTile99 - Cool graphics, for free!

Quote
"PM" <we...@hem.passagen.se> wrote in message

news:87e4u8$5973@bornews.borland.com...
Quote
> Hi,

> Is it possible somehow to make a semi-transparent filled selection
> rectangle?
> I want to use this during runtime to select hotspot areas on a picture.
> It would also be great if I could use different semi-transparent colors of
> the rectangle.
> The rectangle must of course be movable and resizable during runtime.

> I really need help with this!

> Thanks,
> PM

Re:Semi-transparent filled selection rectangle?


Thanks for the tip,

There's one problem though...Paul van D. seems to have withdrawn the
TransCanvas component.
Too bad...

But thanks anyway,
PM

Ps. you don't have it, do you...?

Harm <sharm...@uswest.net> skrev i
diskussionsgruppsmeddelandet:87fhun$5...@bornews.borland.com...

Quote
> Paul van Dinther has a couple of freeware components that might do the
> trick.  One is called TRectBox, the other is called TTransCanvas.

> The TransCanvas is very interesting, I think it does exactly what you're
> looking for - except for the moving and sizing.  TRectBox has the moving
and
> resizing capability, between the two maybe there's an easy solution.
Source
> included.  Find these at:

> http://www.geocities.com/Athens/3683/componentsdesc.htm

> --
> Harm

> Omaha NE

> http://www.users.uswest.net/~sharman1/

>  'sTile99 - Cool graphics, for free!
> "PM" <we...@hem.passagen.se> wrote in message
> news:87e4u8$5973@bornews.borland.com...
> > Hi,

> > Is it possible somehow to make a semi-transparent filled selection
> > rectangle?
> > I want to use this during runtime to select hotspot areas on a picture.
> > It would also be great if I could use different semi-transparent colors
of
> > the rectangle.
> > The rectangle must of course be movable and resizable during runtime.

> > I really need help with this!

> > Thanks,
> > PM

Re:Semi-transparent filled selection rectangle?


Quote
PM wrote:

> Hi,

> Is it possible somehow to make a semi-transparent filled selection
> rectangle?
> I want to use this during runtime to select hotspot areas on a
> picture.
> It would also be great if I could use different semi-transparent
> colors of
> the rectangle.
> The rectangle must of course be movable and resizable during runtime.

> I really need help with this!

> Thanks,
> PM

I use transparency in a couple of programs by calculating pixelvalues
(using scanlines). If the rectangle is not very large this might be
smooth enough.
Another option is to use rasterized bitmap with a transparent colour
(every odd pixel in this transparentcolour). This seems a bit crude but
actually it's almost acceptable in most cases. BTW, it's easier to
program but I'm not sure if it's (much) faster.

Remco

Other Threads