wxPanel에 둥근 모서리가있는 직사각형을 그려야합니다. 아래와 같이 투명하게 표시 할 수 없습니다. 흰색 영역은 투명해야합니다.패널에 투명 비트 맵 그리기
회색 영역은 비트 맵 이며 아래에 wxPanel 배경이있다. 비트 맵 (wxBitmap)를 그리기에 대한 나의 코드는
wxMemoryDC temp;
bitmap.Create(kWidth, kHeight);
temp.SelectObject(bitmap);
temp.SetBackground(*wxWHITE_BRUSH);
temp.Clear();
temp.SetPen(wxPen(wxColor(80, 80, 80), 1));
temp.SetBrush(*wxTRANSPARENT_BRUSH);
temp.DrawRectangle(0, 0, kWidth, kHeight);
temp.SetBrush(wxBrush(backgroundColor));
temp.DrawRoundedRectangle(0, 0, kWidth, kHeight, kRadius);
그리고 (새로 고침) 내 코드를 bliting에 대한
이void draw(wxDC& dc, wxPoint mousePosition)
{
wxMemoryDC temp;
temp.SelectObject(bitmap);
dc.Blit(wxPoint(kLeft, kTop), temp.GetSize(), &temp, wxPoint(0, 0), wxCOPY, true);
}
이다 그러나 위와 같이 출력입니다. 내가 뭘 잘못하고 있니?
비트 맵의 픽셀 형식은 비트 맵 생성자에서 * depth * 인수를 지정하지 않습니다. 32bpp는 알파가 필요하므로 wxWidgets는이를 지원할 수 없습니다. Windows의 경우 gdiplus가 필요합니다. –
알파가 정확히 필요하지 않습니다. 24 비트에서 가능하지 않습니다. 하나의 색깔 만 투명해질 수 있을까요? –
http://msdn.microsoft.com/en-us/library/dd145141%28v=VS.85%29.aspx –