- wxBrush* brush4 = new wxBrush(*gs_bmp4);
- wxBrush* brush4_mono = new wxBrush(*gs_bmp4_mono);
- wxBrush* brush36 = new wxBrush(*gs_bmp36);
-
- wxPoint todraw[5];
- todraw[0].x=(long)x+100;
- todraw[0].y=(long)y+100;
- todraw[1].x=(long)x+300;
- todraw[1].y=(long)y+100;
- todraw[2].x=(long)x+300;
- todraw[2].y=(long)y+300;
- todraw[3].x=(long)x+150;
- todraw[3].y=(long)y+350;
- todraw[4].x=(long)x+100;
- todraw[4].y=(long)y+300;
-
- wxPoint todraw2[5];
- todraw2[0].x=100;
- todraw2[0].y=100;
- todraw2[1].x=300;
- todraw2[1].y=100;
- todraw2[2].x=300;
- todraw2[2].y=300;
- todraw2[3].x=150;
- todraw2[3].y=350;
- todraw2[4].x=100;
- todraw2[4].y=300;
-
- switch (transparent)
- {
- case 0:
- {
- dc.SetLogicalFunction(wxCOPY);
-
- dc.SetPen( wxPen( "black", 4, wxSOLID) );
- dc.SetBrush( *brush4 );
- dc.DrawPolygon(5,todraw,0,0,wxWINDING_RULE);
-
- dc.SetPen( wxPen( "red", 4, wxSOLID) );
- dc.SetBrush( *brush36 );
- dc.SetTextForeground(*wxCYAN);
- dc.SetTextBackground(m_owner->m_colourBackground);
- dc.DrawRectangle( x+10, y+10, 200, 200 );
-
- dc.SetPen( wxPen( "green", 4, wxSOLID) );
- dc.SetBrush( *brush4_mono );
- dc.SetTextForeground(*wxCYAN);
- dc.SetTextBackground(m_owner->m_colourBackground);
- dc.DrawRectangle( x+50, y+50, 200, 200 );
-
- dc.DrawCircle( x+400, y+50, 130 );
-
- dc.SetBrush(wxNullBrush);
- dc.SetPen(wxNullPen);
- break;
- }
- case 1: //now with transparent fillpatterns
- {
-
- wxBitmap* bmpBlit = new wxBitmap(600,400);
- wxMemoryDC* memDC= new wxMemoryDC();
- // wxBrush _clearbrush(*wxGREEN,wxSOLID);
- wxBrush _clearbrush(*wxBLACK,wxSOLID);
- memDC->SelectObject(*bmpBlit);
- memDC->BeginDrawing();
- memDC->SetBackground(_clearbrush);
- memDC->Clear();
- memDC->SetBackground(wxNullBrush);
-
- memDC->SetPen( wxPen( "black", 4, wxSOLID) );
- memDC->SetBrush( wxNullBrush);
- memDC->SetBrush( *brush4 );
- memDC->SetTextForeground(*wxBLACK); // 0s --> 0x000000 (black)
- memDC->SetTextBackground(*wxWHITE); // 1s --> 0xFFFFFF (white)
- memDC->SetLogicalFunction(wxAND_INVERT);
-
- // BLACK OUT the opaque pixels and leave the rest as is
- memDC->DrawPolygon(5,todraw2,0,0,wxWINDING_RULE);
-
- // Set background and foreground colors for fill pattern
- //the previous blacked out pixels are now merged with the layer color
- //while the non blacked out pixels stay as they are.
- memDC->SetTextForeground(*wxBLACK); // 0s --> 0x000000 (black)
-
- //now define what will be the color of the fillpattern parts that are not transparent
- // memDC->SetTextBackground(*wxBLUE);
- memDC->SetTextBackground(m_owner->m_colourForeground);
- memDC->SetLogicalFunction(wxOR);
-
-
- //don't understand how but the outline is also depending on logicalfunction
- memDC->SetPen( wxPen( "red", 4, wxSOLID) );
- memDC->DrawPolygon(5,todraw2,0,0,wxWINDING_RULE);
-
- memDC->SetLogicalFunction(wxCOPY);
-
- memDC->SetPen( wxPen( "black", 4, wxSOLID) );
- memDC->SetBrush( wxNullBrush);
- memDC->SetBrush( *brush36 );
- memDC->SetTextForeground(*wxBLACK); // 0s --> 0x000000 (black)
- memDC->SetTextBackground(*wxWHITE); // 1s --> 0xFFFFFF (white)
- memDC->SetLogicalFunction(wxAND_INVERT);
-
- memDC->DrawRectangle( 10, 10, 200, 200 );
-
- // Set background and foreground colors for fill pattern
- //the previous blacked out pixels are now merged with the layer color
- //while the non blacked out pixels stay as they are.
- memDC->SetTextForeground(*wxBLACK); // 0s --> 0x000000 (black)
- //now define what will be the color of the fillpattern parts that are not transparent
- // memDC->SetTextBackground(*wxRED);
- memDC->SetTextBackground(m_owner->m_colourBackground);
- memDC->SetLogicalFunction(wxOR);
-
- //don't understand how but the outline is also depending on logicalfunction
- memDC->SetPen( wxPen( "yellow", 4, wxSOLID) );
- memDC->DrawRectangle( 10, 10, 200, 200 );
-
- memDC->SetBrush(wxNullBrush);
- memDC->SetPen(wxNullPen);
-
- memDC->EndDrawing();
- dc.Blit(x,y,600,400,memDC,0,0,wxCOPY);
- delete bmpBlit;
- delete memDC;
- break;
- }
- case 2: //now with transparent inversed fillpatterns
- {
- wxBitmap* bmpBlit = new wxBitmap(600,400);
- wxMemoryDC* memDC= new wxMemoryDC();
- wxBrush _clearbrush(*wxWHITE,wxSOLID);
- memDC->SelectObject(*bmpBlit);
- memDC->BeginDrawing();
- memDC->SetBackground(_clearbrush);
- memDC->Clear();
- memDC->SetBackground(wxNullBrush);
-
- memDC->SetPen( wxPen( "black", 4, wxSOLID) );
- memDC->SetBrush( *brush4 );
- memDC->SetTextBackground(*wxBLACK); // 0s --> 0x000000 (black)
- memDC->SetTextForeground(*wxWHITE); // 1s --> 0xFFFFFF (white)
- memDC->SetLogicalFunction(wxAND_INVERT);
-
- // BLACK OUT the opaque pixels and leave the rest as is
- memDC->DrawPolygon(5,todraw2,0,0,wxWINDING_RULE);
-
- // Set background and foreground colors for fill pattern
- //the previous blacked out pixels are now merged with the layer color
- //while the non blacked out pixels stay as they are.
- memDC->SetTextBackground(*wxBLACK); // 0s --> 0x000000 (black)
-
- //now define what will be the color of the fillpattern parts that are not transparent
- memDC->SetTextForeground(m_owner->m_colourForeground);
- memDC->SetLogicalFunction(wxOR);
-
-
- //don't understand how but the outline is also depending on logicalfunction
- memDC->SetPen( wxPen( "red", 4, wxSOLID) );
- memDC->DrawPolygon(5,todraw2,0,0,wxWINDING_RULE);
-
- memDC->SetLogicalFunction(wxCOPY);
-
- memDC->SetPen( wxPen( "black", 4, wxSOLID) );
- memDC->SetBrush( *brush36 );
- memDC->SetTextBackground(*wxBLACK); // 0s --> 0x000000 (black)
- memDC->SetTextForeground(*wxWHITE); // 1s --> 0xFFFFFF (white)
- memDC->SetLogicalFunction(wxAND_INVERT);
-
- memDC->DrawRectangle( 10,10, 200, 200 );
-
- // Set background and foreground colors for fill pattern
- //the previous blacked out pixels are now merged with the layer color
- //while the non blacked out pixels stay as they are.
- memDC->SetTextBackground(*wxBLACK); // 0s --> 0x000000 (black)
- //now define what will be the color of the fillpattern parts that are not transparent
- memDC->SetTextForeground(m_owner->m_colourBackground);
- memDC->SetLogicalFunction(wxOR);
-
- //don't understand how but the outline is also depending on logicalfunction
- memDC->SetPen( wxPen( "yellow", 4, wxSOLID) );
- memDC->DrawRectangle( 10, 10, 200, 200 );
-
- memDC->SetBrush(wxNullBrush);
- memDC->SetPen(wxNullPen);
- dc.Blit(x,y,600,400,memDC,0,0,wxCOPY);
- delete bmpBlit;
- delete memDC;
- }
- }