开发者

How to change the background color of an MFC animation control

开发者 https://www.devze.com 2023-03-30 15:03 出处:网络
I am using an animation control in my MFC dialog box to display an animation. I want to change the background color of this control to match the background color of my dialog box, which is white. I ha

I am using an animation control in my MFC dialog box to display an animation. I want to change the background color of this control to match the background color of my dialog box, which is white. I have tried using the OnCtlColor() method, but app开发者_如何转开发arently the animation control does not invoke OnCtlColor().

Any help on how I can change animation control's background to white? Thanks


I am not sure if this would help or not but surely give this a try.

you have the option of displaying the original background color of the video or seeing through. When creating a video, its author can do it with transparency to allow seeing the color of the host. In this case, to display the color of the host while the video is playing, set the Transparent property to True. If you are creating the control programmatically, add the ACS_TRANSPARENT style:

BOOL CControlsDlg::OnInitDialog() 
{
    CDialog::OnInitDialog();

    // TODO: Add extra initialization here
    RECT Recto = { 5, 5, 360, 360 };

    Player->Create(WS_CHILD | WS_VISIBLE |
              ACS_TRANSPARENT | ACS_AUTOPLAY,
          Recto, this, 0x1884);

    return TRUE; // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}

...

For more info, kindly visit the below link and hopefully you should get some idea from this.

Link: http://www.functionx.com/visualc/controls/animation.htm

Hope this helps.

Cheers.

0

精彩评论

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

关注公众号