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

[提问] 窗口透明度设置 #26

Closed
linzedo opened this issue Jan 17, 2024 · 5 comments
Closed

[提问] 窗口透明度设置 #26

linzedo opened this issue Jan 17, 2024 · 5 comments
Labels
问答 记录问答以供其他人查看

Comments

@linzedo
Copy link

linzedo commented Jan 17, 2024

能否实现红色框内为全透明,边框不透明的效果
企业微信截图_1705457055625

@twgh
Copy link
Owner

twgh commented Jan 17, 2024

没接触过设计器的可以先看wiki里的文章。
设计器里新建一个界面设计项目,把下面的代码保存到xml文件,放设计器项目里,运行下就是你要的效果。
实现过程是给窗口设置为透明窗口,然后通过背景编辑器给窗口添加背景信息,给整个窗口背景放一个矩形上去铺满窗口。矩形的填充色白色,不透明度改1。矩形的描边色红色,线宽2。

<?xml version="1.0" encoding="UTF-8"?>
<!--炫彩界面库-窗口布局文件-->
<head />
<windowUI bkInfoM="{99:1.9.9;98:1(0);5:2(15)20(1)21(3)26(1)22(33554431)23(1)10(1)7(2)11(3)16(1)12(-16776961)13(255);}" content="炫彩界面库 - 我的窗口名" rect="20,20,699,446" showT="true" transparentAlpha="255" transparentFlag="shaped" windowStyle="2047" />

@linzedo
Copy link
Author

linzedo commented Jan 18, 2024

那如何自适应宽度变化呢,高度不变
企业微信截图_17055614121646

@twgh
Copy link
Owner

twgh commented Jan 18, 2024

<?xml version="1.0" encoding="UTF-8"?>

<!--炫彩界面库-窗口布局文件-->

<head />

<windowUI bkInfoM="{99:1.9.9;98:1(0);5:2(15)20(1)21(3)26(1)22(33554431)23(1)10(1)7(2)11(3)16(1)12(-16776961)13(255);}" content="炫彩界面库 - 我的窗口名" enableLayout="true" rect="20,20,699,446" showT="true" transparentAlpha="255" transparentFlag="shaped" windowStyle="2047">

 <layoutEleUI bkInfoM="{99:1.9.9;98:16(0);5:2(15)20(1)21(3)26(1)22(-65536)23(255);}" layout.height="fill" layout.width="100" rect="89,131,100,100" showT="true" expandT="true" />

 <layoutEleUI bkInfoM="{99:1.9.9;98:16(0);5:2(15)20(1)21(3)26(1)22(-65536)23(255);}" layout.float="true" layout.height="fill" layout.width="100" rect="109,151,100,100" showT="true" expandT="true" />

</windowUI>

@linzedo linzedo closed this as completed Jan 19, 2024
@twgh twgh added the 问答 记录问答以供其他人查看 label Apr 16, 2024
@linzedo linzedo reopened this May 10, 2024
@linzedo
Copy link
Author

linzedo commented May 10, 2024

中间透明的部分,能否做到真正的镂空,就鼠标可以点击框背后的程序

@twgh
Copy link
Owner

twgh commented May 11, 2024

设计器里打开上面的xml, 在窗口的背景编辑器里, 把右边的不透明度从1改0

@linzedo linzedo closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
问答 记录问答以供其他人查看
Projects
None yet
Development

No branches or pull requests

2 participants