QMovie 中的动画 GIF
我通过创建 QLabel 并将电影设置为 QMovie 在我的应用程序中显示动画 gif。我遇到的问题是,当显示 gif 时,在整个动画中保持恒定颜色的图像的任何部分都会显示为背景颜色。我希望我能清楚地解释这一点。这是我用来创建动画的代码(如果有帮助的话):
rewardLabel=new QLabel();
rewardLabel->setCursor(QCursor(Qt::BlankCursor));
rewardLabel->setWindowFlags(Qt::FramelessWindowHint);
rewardLabel->hide();
string movieTemp="animations/"+animationFiles[animationIndex];
QString movieFile(movieTemp.c_str());
rewardMovie=new QMovie(movieFile);
rewardLabel->setMovie(rewardMovie);
如果我需要更好地解释情况,请告诉我。提前致谢。
I'm displaying an animated gif in my application by creating a QLabel, and setting the movie as a QMovie. The problem I'm having is that when the gif is displayed, any part of the image that stays a constant color throughout the animation shows up as the background color. I hope I'm explaining that clearly. Here's the code I'm using to create the animation if that helps:
rewardLabel=new QLabel();
rewardLabel->setCursor(QCursor(Qt::BlankCursor));
rewardLabel->setWindowFlags(Qt::FramelessWindowHint);
rewardLabel->hide();
string movieTemp="animations/"+animationFiles[animationIndex];
QString movieFile(movieTemp.c_str());
rewardMovie=new QMovie(movieFile);
rewardLabel->setMovie(rewardMovie);
Let me know if I need to explain the situation better. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下
QWidget
的窗口属性。我相信您感兴趣的是:可能有几个 小部件flags 也很有趣,但我认为它们都已转移到 Qt-4 中的 flags 中。
Take a look at the
QWidget
s window attributes. I believe the ones you're interested in are:There might be a couple of widget flags of interest too, but I think they've all been moved to flags in Qt-4.