Transparency of BufferedGraphics

G

Guest

--
qbeec

Hi everyone! I'm not sure whether this is the right place to ask about but
If not so, can anyone redirect me to right place. Anyway here is my problem:

I created a simple Windows Form which has a transparent background color,
Let's say color1. This Form also contains a BufferedGraphics object (grafx).
My aim is to make grafx has a transparent background, too. When I run my
application it works fine(grafx and form both have transparent backgrounds),
however when I clear grafx to draw something new, I lose the transparency of
grafx. It becomes simply black even if I pick color1 as black. How can I
reach transparency options of BufferedGraphics object if something like that
exists? if you have a solution for making grafx transparent without dealing
with that sort of options that would be cool,too.(If you want I can send
Onpaint or other functions) Thanks everyone...

(VS2005 express,XP sp2,)
 
G

Guest

With BufferedGraphics you have to copy the background you want behind what
you draw before you draw it. BufferGraphics draws off-screen and is then
copied on-screen. If you don't copy what you want for the background while
off-screen you'll be drawing transparently over an inconsistent background.
 
S

Stuart Nathan

I am very curious as to how you draw a transparent form, because forms don't
accept the color.transparent as a background colour. Incidently if you use
VS2005, the form has a Buffered property which you can set to true.

As far as I am aware, what windows actually does is to capture the
background graphics and copies it onto your object. So if you move your
form, what happens?
 
G

Guest

I solved my stupid question by chance.
grafx->Graphics->Clear(System::Drawing::Color::Transparent);
Anyway yeah Stuart you cannot pick transparent as your form's background
then it gives a runtime error, but you can pick any transparencyKey different
than transparent. Whatever, I guess the transparencykey of the form becomes
transparencykey for all components in that form. Additionally you can still
draw some shapes to a bufferedgraphics objects in your transparencyKey that's
the good point :)). Have you ever used media player 9 or windows live
messenger, i'm planning to achieve some skin like theirs. Smooth corners,
color variety etc...

Thanks dudes,

-- qbeec (Sorry for my terrible English)
 

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