You can create multiple regions using CreateRectRgn for each individual post in your 'fence'. Combine them into a single region using CombineRgn, then call SetWindowRgn to restrict your window's display to this region.Gavin
- Edited by glotter Tuesday, September 10, 2013 1:38 PM
When I use SetLayeredWindowAttributes with
LWA_ALPHA, the whole window is semi-transparent;
LWA_COLORKEY, the background becomes complete transparent;
both LWA_ALPHA and LWA_COLORKEY, background transparent, objects semi-transparent.
While I want background semi-transparent, and objects opaque.
You don't want SetLayeredWindowAttributes. You want UpdateLayeredWindow for per-pixel alpha transparency. In the docs I linked skim down to the paragraph starting "For faster and more efficient animation or if per-pixel alpha is needed, call UpdateLayeredWindow. "
This will let you control the transparency level for each pixel individually: you can set the background pixels partially transparent and leave your main objects fully opaque.