画一个填满的圆圈 [英] draw a filled up circle
本文介绍了画一个填满的圆圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我编写了一个函数,它必须在我的图形场景中绘制一个填充的黑色圆圈.该函数绘制了一个黑色的带圆圈的圆圈但没有填满?这是我的功能:
I've written a function that must draw a filled up black circle on my graphicsscene. The function draws a black lined circle but not filled up? This is my function:
void World::damage(int x, int y)
{
QPainter painter(&worldImage);
painter.setBrush(QBrush(Qt::black));
painter.drawArc(x,y,150,50,0,16*360);
item = new QGraphicsPixmapItem(QPixmap::fromImage(worldImage));
this->addItem(item);
}
亲切的问候,
推荐答案
drawArc()
不使用填充颜色,使用 drawEllipse()
表示一个完整的圆.
drawArc()
does not use a fill color, use drawEllipse()
for a full circle that is filled.
这篇关于画一个填满的圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文