void wxQtDCImpl::SetBrush(const wxBrush& brush) { m_brush = brush; if (brush.GetStyle() == wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE) { // Use a monochrome mask: use foreground color for the mask QBrush b(brush.GetHandle()); b.setColor(m_textForegroundColour.GetHandle()); b.setTexture(b.texture().mask()); m_qtPainter->setBrush(b); } else if (brush.GetStyle() == wxBRUSHSTYLE_STIPPLE) { //Don't use the mask QBrush b(brush.GetHandle()); QPixmap p = b.texture(); p.setMask(QBitmap()); b.setTexture(p); m_qtPainter->setBrush(b); } else { m_qtPainter->setBrush(brush.GetHandle()); } ApplyRasterColourOp(); }
/***************************************************** ** ** PdfPainter --- setBrush ** ******************************************************/ void PdfPainter::setBrush( const wxBrush &b ) { // TODO howto scale width und height if ( b.GetStyle() == wxSTIPPLE ) { wxImage image; wxBitmap *bitmap = b.GetStipple(); if ( bitmap && bitmap->IsOk()) { image = bitmap->ConvertToImage(); double width = image.GetWidth() / 3; double height = image.GetHeight() / 3; // setup a hash value for the image wxString s = createImageHash( &image ); pdf->AddPattern( s, image, width, height ); drawmode = wxPDF_STYLE_FILL; pdf->SetFillPattern( s ); pdf->SetDrawPattern( s ); } } else if ( b.GetStyle() != wxTRANSPARENT && b.GetColour().IsOk() ) setBrushColor( b.GetColour() ); else { drawmode = wxPDF_STYLE_DRAW; } }
void wxGraphicsContext::SetBrush( const wxBrush& brush ) { if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT ) SetBrush( wxNullGraphicsBrush ); else SetBrush( CreateBrush( brush ) ); }
void wxGenericBrush::Set( const wxBrush &brush ) { wxCHECK_RET(Ok() && brush.Ok(), wxT("Invalid generic brush")); SetColour(brush.GetColour()); M_GBRUSHDATA->m_style = brush.GetStyle(); wxBitmap* stipple = brush.GetStipple(); if (stipple && stipple->Ok()) M_GBRUSHDATA->m_stipple = *stipple; }
wxString xsBrushPropIO::ToString(wxBrush value) { return wxString::Format(wxT("%s %d"), xsColourPropIO::ToString(value.GetColour()).c_str(), value.GetStyle()); }