简体   繁体   English

如何更改MFC动画控件的背景颜色

[英]How to change the background color of an MFC animation control

I am using an animation control in my MFC dialog box to display an animation. 我在MFC对话框中使用动画控件来显示动画。 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 apparently the animation control does not invoke OnCtlColor(). 我尝试使用OnCtlColor()方法,但是显然动画控件不会调用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: 如果要以编程方式创建控件,请添加ACS_TRANSPARENT样式:

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 链接: http//www.functionx.com/visualc/controls/animation.htm

Hope this helps. 希望这可以帮助。

Cheers. 干杯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM