Advertisement

Transparent Windows

Started by February 06, 2000 04:52 PM
6 comments, last by C++ Freak 24 years, 10 months ago
Is it possible to make a transparent window? That would be sweet because then you could little animations on the desktop without having a white or black boz around it. Visit http://members.xoom.com/ivanickgames
Visit http://members.xoom.com/ivanickgames
I think there is a way to do this kind of thing, not exactly by making a transparent window I believe, but look at some of the DirectX examples (donut?) and also do you remeber those old desktop pets?
Catz, Dogz, etc....

Take it easy,

-Mezz
Advertisement
Take a look at SetWindowRgn. It will take in a bunch of points to form a polygon to set your window to.
For our latest game, I made a little scrolling credits dialog... the cool part is that the window is shaped like a rhino head. *grin*

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
I''ve used CreatePolyRgn and SetWindowRgn and it works, but I''m wondering if anyone knows how to do this by loading a bitmap and making a certain color transparent, with the same effect as the SetWindowRgn? I''ve seen some applications doing this...

Anyone knows?
I don''t think there''s a clean way to do it in a pre-W2k OS. But W2k has added a whole bunch of stuff to improve windows and generally make then cooler. MSDN had an article about it i believe.

"That which the flame does not consume...consumes the flame. "
"That which the flame does not consume...consumes the flame. "
Notthingham, are you referring to C++ Freak''s question, or mine on your last post? If it was mine, I saw the application running on Windows 95 actually. It allowed the user to load any bitmap (24-bit) and take one of the colors and make it transparent.
Advertisement
If you go to http://www.codeguru.com/bitmap/bmp_to_rgn.shtml you will find an article on converting a bitmap to a region. You can then use the created region in a call to SetWindowRgn and, voila!, your window will be in the shape of the bitmap.

One little tip when doing this. Try to avoid an overly complex shape as the Windows cliper will slow down quite considerably when you have a complex region.
http://msdn.microsoft.com/isapi/msdnlib.idc?theURL=/library/techart/layerwin.htm

is the link to how to do it in Windows 2000.

This topic is closed to new replies.

Advertisement