Get the App
SLTechnology News&Howtos  ›  Development  › 

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

Shulou Source: shulou.com Published: 2022-06-02 06:39:26 10月27日 Update

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 ()

Tags: Methods animation content attributes coding learning practicality deeper interest size characters strings practicality practical controls controllers plug-ins simple operation text more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker vpn Apple MariaDB NVidia