views:

375

answers:

1

I'm using C# to create a non standard shape WPF window, and because of some problems with "AllowTransparency=True", I used CreateRoundRectRgn, CreateEllipticRgn and SetWindowRgn win32 API Region functions, but there's a problem cause the edges are not smooth as you can see in the picture here http://img17.imageshack.us/img17/206/sampley.png:

How can I achieve antialiasing for the edges to look more smooth ?

A: 

You can't, anti-aliased edges require per-pixel alpha channel (what AllowTransparency=true does) - but when you turn that option on (either using AllowTransparency or by invoking the Win32 API, the result is the same) you get into a whole lot of trouble - like you already discovered.

Nir