示例#1
0
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();
}
示例#2
0
/*****************************************************
**
**   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;
	}
}
示例#3
0
void wxGraphicsContext::SetBrush( const wxBrush& brush )
{
    if ( !brush.Ok() || brush.GetStyle() == wxTRANSPARENT )
        SetBrush( wxNullGraphicsBrush );
    else
        SetBrush( CreateBrush( brush ) );
}
示例#4
0
文件: genergdi.cpp 项目: Jarlene/mrpt
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;
}
示例#5
0
wxString xsBrushPropIO::ToString(wxBrush value)
{
    return wxString::Format(wxT("%s %d"), xsColourPropIO::ToString(value.GetColour()).c_str(), value.GetStyle());
}