|
-
Apr 30th, 2005, 02:17 AM
#1
Thread Starter
Fanatic Member
fast round windows in Win32
Hello -
recently I have been trying to use round windows for an application.
These must be moved, but do not have to be resized.
Unfortunately, I have tried a few ways and they all seem to be VERY slow at rendering the window whenever I move it.
Both CRgn (MFC) and HRGN (using CreateEllipticRegion() and SetWindowRgn()) are way to slow for my use. If I just have a 200x200 box, keeping it rectangle, it's fine.
So, is there a faster way to have transparent space?
Or even is there a way which I can control which pixels get drawn and which do not? The windows are only 200x200, so just looping and calculating where to start and end the loop will make it < 40000 calculations, which is fast enough easily.
Thanks for your help.
sql_lall 
-
Apr 30th, 2005, 05:49 AM
#2
Re: fast round windows in Win32
If you have Win2K+, try using alpha blending. Make a circle in Paint/Photoshop etc. Make sure it sits on a solid colour background, like white (255,255,255), green (0,255,0) etc. Use it as the background for your window. Then set your window as Layered (SetWindowLong and WS_EX_LAYERED) and use SetLayeredWindowAttributes to make the form transparent. Pass the long rgb value of your background colour, and voila, Windows draws that colour transparent.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|