开发者

Qt - How to show gif(animated) image in QGraphicsPixmapItem

开发者 https://www.devze.com 2023-02-28 21:57 出处:网络
I am trying to use one blinking image开发者_JAVA技巧 in QGraphicsPixmapItem. The image has shown without the animation effect. The below is the original image, the following is the QGraphicsScene whic

I am trying to use one blinking image开发者_JAVA技巧 in QGraphicsPixmapItem. The image has shown without the animation effect. The below is the original image, the following is the QGraphicsScene which uses this image in QGraphicsPixmapItem. Can anybody say how to achieve this?.

Qt - How to show gif(animated) image in QGraphicsPixmapItem

Qt - How to show gif(animated) image in QGraphicsPixmapItem


use this code

QGraphicsScene scene;
QLabel *gif_anim = new QLabel();
QMovie *movie = new QMovie(image);
gif_anim->setMovie(movie);
movie->start();
QGraphicsProxyWidget *proxy = scene.addWidget(gif_anim);
0

精彩评论

暂无评论...
验证码 换一张
取 消