Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for QT to display gif and flash animations

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The main content of this article is to explain "what is the method of QT displaying gif and flash animation". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the method of QT displaying gif and flash animation"?

# include # include / / QAxObject * documents = word.querySubObject ("Documents"); void gifplay (QLabel * label) {label- > show ();} void gifclose (QLabel * label) {label- > close ();}

Void flashplay (QAxWidget * flash) {flash- > show ();} void flashclose (QAxWidget * flash) {flash- > close ();} int main (int argc, char * argv []) {QApplication a (argc, argv); QTextCodec::setCodecForLocale (QTextCodec::codecForName ("gb18030")); / / QTextCodec::setCodecForCStrings (QTextCodec::codecForName ("gb18030")); / / QTextCodec::setCodecForTr (QTextCodec::codecForName ("gb18030"))

QAxWidget * flash = new QAxWidget (0QString name=qApp- 0); flash- > resize (600400); flash- > setControl ("{d27cdb6e-ae6d-11cf-96b8-444553540000}"); QString name=qApp- > applicationDirPath (); flash- > dynamicCall ("LoadMovie (long,string)", 0LQ App-> applicationDirPath () + "/ flash2.swf"); flash- > show (); return a.exec () / / QTextCodec * codec = QTextCodec::codecForName ("GB2312"); / / text is GB2312 editor / / QTextCodec::setCodecForLocale (codec); / / set local encoding / / QTextCodec::setCodecForCStrings (codec); / / set string encoding / / QTextCodec::setCodecForTr (codec); / * QAxWidget * flash = new QAxWidget (0Magazine 0); / / QAxWidget uses ActiveX plug-in flash- > resize (800600) / / set the initial size of the control flash- > setControl (QString::fromUtf8 ("{d27cdb6e-ae6d-11cf-96b8-444553540000}")); / / set the controller flash- > dynamicCall ("LoadMovie (long,string)", 0, "D:\ QT_test\\ build-donghua-Desktop_Qt_5_7_0_MinGW_32bit-Debug\\ flash2.swf"); / /

/ / flash- > dynamicCall ("D:\\ QT_test\\ build-donghua-Desktop_Qt_5_7_0_MinGW_32bit-Debug\\ flash2.swf", 0 0); / / flash- > setWindowFlags (Qt::FramelessWindowHint); / / remove the border

/ / ui- > wInfoShow- > setPlainText (flash- > dynamicCall ("TotalFrames") ToString (); / / get properties flash- > dynamicCall ("FrameNum", 200); / / set properties flashplay (flash); QTime t; t.start (); while (t.elapsed () setGeometry (300,300,500,500); label- > setMovie (movie); label- > setScaledContents (true); movie- > start (); gifplay (label); QTime t; t.start (); while (t.elapsed ()

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report