drawing NOT filled Rectangles?

Oct 15, 2014 at 9:55pm
hey guys, i have a suppose-to-be simple task which i can't figure out:
how do i draw a simple "transparent" rectangle (Win32 GDI).
i'm using a solid pen.

Google only finds how to draw Filled rectangles..

thanks.
Oct 15, 2014 at 10:14pm
If you are using the Rectangle WinAPI function, it will use whatever brush is currently selected into the DC to fill the rect.

If you want no filling, then select a null brush:

1
2
SelectObject( mydc, GetStockObject( NULL_BRUSH ) );
Rectangle( ... ); // <- will be 'transparent'/unfilled 
Oct 15, 2014 at 10:32pm
Thanks!!
i think by default rectangles should be transparent, and filled by will, but windows decides to fill them white..
Topic archived. No new replies allowed.