Display GIF images on MFC (use the GIF animation control)

Source: Internet
Author: User

I have been thinking about displaying a GIF image on the MFC dialog since last night. However, it is difficult to find a useful control and use it, however, the official website does not offer great help. There is also a lack of files. I have sorted them out here. Process

1: a total of five files are required, including 3 h and 2 CPP files,

I will add it later.

 

2: import the data to your own project separately. The next step is the operation.

3: In the resource design of your own DLG, add a static text box and assign the ID Wei idc_gif_animation to the text box, right-click the text box and choose ">" create Class Wizard ">" member variables ">" idc_gif_animation ". Double-click"-"And enter" m_animation "as the variable name, and select" control "as the directory ", select cstatic as the type.

4: Find cstatic m_animation in the H of the DLG and change it to cgifanimation m_animation; and add # include "gifanimation. H" to this H"

5: Add:

M_animation.loadanimatedgif ("./RES/1.gif ");
M_animation.play ();

 

6: compile.

 

Here is a description on the official website, which is similar

Http://www.codeproject.com/KB/static/gifanimation.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.