Ejemplo n.º 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();
}
Ejemplo n.º 2
0
void wxQtDCImpl::SetBackground(const wxBrush& brush)
{
    m_backgroundBrush = brush;
    
    if (m_qtPainter->isActive())
        m_qtPainter->setBackground(brush.GetHandle());
}