Qyoto.QPainterPath.CubicTo C# (CSharp) Method

CubicTo() public method

public CubicTo ( QPointF ctrlPt1, QPointF ctrlPt2, QPointF endPt ) : void
ctrlPt1 QPointF
ctrlPt2 QPointF
endPt QPointF
return void
        public void CubicTo(QPointF ctrlPt1, QPointF ctrlPt2, QPointF endPt)
        {
            interceptor.Invoke("cubicTo###", "cubicTo(const QPointF&, const QPointF&, const QPointF&)", typeof(void), typeof(QPointF), ctrlPt1, typeof(QPointF), ctrlPt2, typeof(QPointF), endPt);
        }

Same methods

QPainterPath::CubicTo ( double ctrlPt1x, double ctrlPt1y, double ctrlPt2x, double ctrlPt2y, double endPtx, double endPty ) : void

Usage Example

Ejemplo n.º 1
0
Archivo: mouse.cs Proyecto: KDE/qyoto
    public override void Paint(QPainter painter, QStyleOptionGraphicsItem option, QWidget widget)
    {
        // Body
        painter.SetBrush(color);
        painter.DrawEllipse(-10, -20, 20, 40);

        // Eyes
        painter.SetBrush(Qt.GlobalColor.white);
        painter.DrawEllipse(-10, -17, 8, 8);
        painter.DrawEllipse(2, -17, 8, 8);

        // Nose
        painter.SetBrush(Qt.GlobalColor.black);
        painter.DrawEllipse(new QRectF(-2, -22, 4, 4));

        // Pupils
        painter.DrawEllipse(new QRectF(-8.0 + mouseEyeDirection, -17, 4, 4));
        painter.DrawEllipse(new QRectF(4.0 + mouseEyeDirection, -17, 4, 4));

        // Ears
        painter.SetBrush(Scene().CollidingItems(this).Count == 0 ? Qt.GlobalColor.darkYellow : Qt.GlobalColor.red);
        painter.DrawEllipse(-17, -12, 16, 16);
        painter.DrawEllipse(1, -12, 16, 16);

        // Tail
        QPainterPath path = new QPainterPath(new QPointF(0, 20));
        path.CubicTo(-5, 22, -5, 22, 0, 25);
        path.CubicTo(5, 27, 5, 32, 0, 30);
        path.CubicTo(-5, 32, -5, 42, 0, 35);
        painter.SetBrush(Qt.BrushStyle.NoBrush);
        painter.DrawPath(path);
    }