Cannot draw on wxMemoryDC using colour 0xc0c0c0
chris elliott
biol75 at york.ac.uk
Mon Feb 4 08:02:28 PST 2008
This is not a great surprise; look at the note in src/msw/window.cpp
about line 4336, about reserving this colour as a mask
chris
Leslie Newell wrote:
> Hi, I have just hit a really strange problem with wxMemoryDC. I am
> trying to draw a simple rectangle on a wxBitmap using wxMemoryDC. It
> works fine if I use any colour other than 0xc0c0c0. For instance
> 0xc1c1c1, 0xbfbfbf or 0xc0c0c1 work with no problems. Below is the code
> I am using:
>
> size_t nCheckWidth = wxOwnerDrawn::GetDefaultMarginWidth(),
> nCheckHeight = wxOwnerDrawn::GetDefaultMarginWidth();
> wxBitmap bmp(nCheckWidth + 1,nCheckHeight +1);
> wxMemoryDC dc(bmp);
> wxColour bkCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
> wxBrush bkBrush(bkCol);
> dc.SetBackground(bkBrush);
> dc.Clear();
> dc.SetBrush(*wxTRANSPARENT_BRUSH);
> dc.SetPen(wxPen(wxColour(0xc0,0xc0,0xc0)));
> dc.DrawRectangle(1,1, nCheckWidth-2, nCheckHeight-2);
> return(bmp);
>
> wxWidgets 2.8.6, MSW, compiled with msvc (Visual Studio 2005)
>
> Les
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help at lists.wxwidgets.org
>
More information about the wx-users
mailing list