Transparent brush

Transparent brush

Post by Nicolas Raz » Fri, 01 Oct 1999 04:00:00



Hi

Does anoybody know how to create a user-defined transparent HBRUSH ?

    - the function CreateHatchBrush can do that but it works only with a few
standard patterns,
    - the function CreatePatternBrush can create a user-defined brush from a
bitmap but without transparency...

Is it even possible under Windows ?

Thanks

--
Nicolas Razy

 
 
 

Transparent brush

Post by Thomas W. Brow » Fri, 01 Oct 1999 04:00:00



> Hi

> Does anoybody know how to create a user-defined transparent HBRUSH ?

>     - the function CreateHatchBrush can do that but it works only with a few
> standard patterns,
>     - the function CreatePatternBrush can create a user-defined brush from a
> bitmap but without transparency...

> Is it even possible under Windows ?

Do you mean a brush that is totally transparent?  If so try the brush
returned by GetStockObject(NULL_BRUSH).  However, I suspect you mean a
brush that uses an arbitrary mask and I'm not aware of any ability to
set transparency in this case.  You can get transparency in an icon or
through a series of blits with a mask and bitmap.

-- Thomas Brown


 
 
 

Transparent brush

Post by Nicolas Raz » Fri, 01 Oct 1999 04:00:00


Yes, I mean a brush made out of a transparent pattern, like the standard
hatch brushes
HS_BDIAGONAL or HS_CROSS which are transparent as soon as you call
SetBkMode(hdc, TRANSPARENT).

The only difference is that I would like to define my own transparent
monochrome patterns...



>> Hi

>> Does anoybody know how to create a user-defined transparent HBRUSH ?

>>     - the function CreateHatchBrush can do that but it works only with a
few
>> standard patterns,
>>     - the function CreatePatternBrush can create a user-defined brush
from a
>> bitmap but without transparency...

>> Is it even possible under Windows ?

>Do you mean a brush that is totally transparent?  If so try the brush
>returned by GetStockObject(NULL_BRUSH).  However, I suspect you mean a
>brush that uses an arbitrary mask and I'm not aware of any ability to
>set transparency in this case.  You can get transparency in an icon or
>through a series of blits with a mask and bitmap.

>-- Thomas Brown