void IndicatorWindow::xDrawPolygon( const QVector< QPoint >& pts, bool filled, QRgb color, int line_width ){ XGCValues gcVals; gcVals.line_width = line_width; XChangeGC( display( ), pixGc( ), GCLineWidth, &gcVals ); XSetForeground( display( ), pixGc( ), color ); XSetFillStyle(display( ), pixGc( ), FillOpaqueStippled); XPoint *points = new XPoint[pts.size( )]; for ( int i = 0; i < pts.size( ); ++i ) { points[i].x = pts.at( i ).x( ); points[i].y = pts.at( i ).y( ); } XFillPolygon(display( ), drawable( ), pixGc( ), points, pts.size( ), Complex, 0); delete [] points;}
C++ (Qt)void QBrush::setStyle ( Qt::BrushStyle style )
C static Pixmap stipple;if( !stipple ){ char stipple_bits[] = { 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77, /* Slant Right */ 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77, 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77, 0xee, 0xee, 0xdd, 0xdd, 0xbb, 0xbb, 0x77, 0x77 }; stipple = XCreateBitmapFromData( display(), DefaultRootWindow( display() ), stipple_bits, 16, 16 );} XSetStipple( display(), pixGc(), stipple );XSetFillStyle( display(), pixGc(), FillStippled );