Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control控件设置alpha值的问题 #55

Closed
smallevilbeast opened this issue Jun 26, 2019 · 3 comments
Closed

Control控件设置alpha值的问题 #55

smallevilbeast opened this issue Jun 26, 2019 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@smallevilbeast
Copy link
Contributor

smallevilbeast commented Jun 26, 2019

问题现象

在XML中设置alpha值为102,并且设置了bkimage, 这时显示后是正常的,在程序运行时,在代码中使用SetBkImage重新设置了一张新的本地图片后,就变成空白了,并没有显示新的图片

<Control name="wx_avatar" width="45" height="45" borderround="45,45" halign="center" bkimage="head/default.png" alpha="102" mouse="false" /> 

使用代码设置背景图后就显示异常,如果alpha值为255,则没有问题

m_pControlAvatar->SetBkImage(sLocalAvatar);
@nmgwddj nmgwddj added the question Further information is requested label Jun 26, 2019
@nmgwddj nmgwddj self-assigned this Jun 27, 2019
@nmgwddj
Copy link
Collaborator

nmgwddj commented Jun 27, 2019

这个版本针对有 alpha 属性的控件有一些改动,感谢您的反馈,我会跟踪排查这个问题。

@nmgwddj
Copy link
Collaborator

nmgwddj commented Jul 8, 2019

@lovesnow 我根据你的提示没能成功复现这个问题,我的操作步骤是:

1、复制你上面 Control 控件的信息添加到 basic 项目的 xml 中。
2、复制了两个图片到资源 basic/head 目录下
image
3、给 Label 控件添加了一个 ButtonDown 的响应时间来切换图片

dynamic_cast<ui::Label*>(FindControl(L"tooltip"))->AttachButtonDown([this](ui::EventArgs* msg){
	FindControl(L"wx_avatar")->SetBkImage(L"head/wan_heads.png");
	return true;
});

最终效果:
head

@smallevilbeast
Copy link
Contributor Author

好的 我测试下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants