Hi ,

I am able to draw transperant lables by overriding OnPaint and using
"Drawstring" of the graphics class.
Do any one know about a more flexible approach to have transperant labels.?

I have a embedded resource background and I need to have labels on the
background without the whitepatch of the label background.

Thanks in advance,

Rookie

RE: TransperantLabel by dbgrick

dbgrick
Tue Jun 19 10:31:00 CDT 2007

The other way is to create a mask image. You would set all transparent bits
to RGB(255,255,255) and all non transparent bits to RGB(0,0,0) and on your
original image set all transparent bits to RGB(0,0,0) and all non transparent
bits to the original color. Then you would draw the mask image using SRCAND
and the altered original image using SRCPAINT. This can be very painful;
thus, your way is probably the easiest.

Rick D.
Contractor

"Rookie" wrote:

> Hi ,
>
> I am able to draw transperant lables by overriding OnPaint and using
> "Drawstring" of the graphics class.
> Do any one know about a more flexible approach to have transperant labels.?
>
> I have a embedded resource background and I need to have labels on the
> background without the whitepatch of the label background.
>
> Thanks in advance,
>
> Rookie

RE: TransperantLabel by Rookie

Rookie
Tue Jun 19 10:46:01 CDT 2007

Thanku Rick. Iam working on an enterprise level application, And I think
OnPaints would reduce the responsetime of the application,I will keep looking
and post back if i find a better method.
Thanks,

"dbgrick" wrote:

> The other way is to create a mask image. You would set all transparent bits
> to RGB(255,255,255) and all non transparent bits to RGB(0,0,0) and on your
> original image set all transparent bits to RGB(0,0,0) and all non transparent
> bits to the original color. Then you would draw the mask image using SRCAND
> and the altered original image using SRCPAINT. This can be very painful;
> thus, your way is probably the easiest.
>
> Rick D.
> Contractor
>
> "Rookie" wrote:
>
> > Hi ,
> >
> > I am able to draw transperant lables by overriding OnPaint and using
> > "Drawstring" of the graphics class.
> > Do any one know about a more flexible approach to have transperant labels.?
> >
> > I have a embedded resource background and I need to have labels on the
> > background without the whitepatch of the label background.
> >
> > Thanks in advance,
> >
> > Rookie

Re: TransperantLabel by ctacke/>

ctacke/>
Tue Jun 19 11:39:32 CDT 2007

"Enterpise level" has little to do with it. OnPaint is happening whether
you override or not, so the "perf hit" will be minimal provided you don't
create large objects every time or some crazy thing like that.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com



"Rookie" <Rookie@discussions.microsoft.com> wrote in message
news:12874B75-72AA-41FA-A063-15B874B5AC44@microsoft.com...
> Thanku Rick. Iam working on an enterprise level application, And I think
> OnPaints would reduce the responsetime of the application,I will keep
> looking
> and post back if i find a better method.
> Thanks,
>
> "dbgrick" wrote:
>
>> The other way is to create a mask image. You would set all transparent
>> bits
>> to RGB(255,255,255) and all non transparent bits to RGB(0,0,0) and on
>> your
>> original image set all transparent bits to RGB(0,0,0) and all non
>> transparent
>> bits to the original color. Then you would draw the mask image using
>> SRCAND
>> and the altered original image using SRCPAINT. This can be very
>> painful;
>> thus, your way is probably the easiest.
>>
>> Rick D.
>> Contractor
>>
>> "Rookie" wrote:
>>
>> > Hi ,
>> >
>> > I am able to draw transperant lables by overriding OnPaint and using
>> > "Drawstring" of the graphics class.
>> > Do any one know about a more flexible approach to have transperant
>> > labels.?
>> >
>> > I have a embedded resource background and I need to have labels on the
>> > background without the whitepatch of the label background.
>> >
>> > Thanks in advance,
>> >
>> > Rookie