Transparent part is not painted

O

ORC

Hi,

I have made a custom control - a button that is able to show an image. The
image can have a transparent background and is sometimes placed halfway on
top of another control.

Following is part of the code that is placed in the 'OnPaint' event:

ImageAttributes imageAttr = new ImageAttributes();
imageAttr.SetColorKey( bitmapTransparentColor, bitmapTransparentColor);

e.Graphics.DrawImage(image, imgRect, 0, 0, image.Width, image.Height,
GraphicsUnit.Pixel, imageAttr);


But the part that is transparent isn't updated / painted - what have I
missed?.

Thanks - your respons is highly appreciated
Ole
 
P

Peter Foot [MVP]

CE doesn't support transparent windows so all that happens is it doesn't
draw the areas you mask off with the colorkey. Therefore unless your
OnPaintBackground fills the background of the control, you will end up with
an area which doesn't redraw.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups? Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
 
O

ORC

Thanks for your prompt reply!

Is it possible to get an image of a specified rectangle from the windows
beneath?

Thanks
Ole
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top