Comments (6)
@TonyDragonlake 我学习一下,不过我记得你可以直接设置窗口的透明色吧,D2D渲染上去什么都可以,感觉不需要在D2D的这一层做。不过这样可能不支持磨砂玻璃效果。
from gacui.
@TonyDragonlake 这篇文章是给D2D渲染用的,GDI的话从vista开始就支持设置图片作为背景的同时用alpha通道作为每一个像素的透明度的
from gacui.
没有直接支持,你可以用GacUIWindows.h里面的vl::presentation::windows::GetWindowsForm
,拿到HWND然后调用API来做。
from gacui.
Direct2DWindowsNativeWindowListener_1_0里Alpha通道是可以通过设置D2D1_RENDER_TARGET_PROPERTIES属性设置的(GacUI/Source/NativeWindow/Windows/Direct2D/WinDirect2DApplication.cpp,第97行),然后只要用DwmEnableBlurBehindWindow就可以把底色去掉;
Direct2DWindowsNativeWindowListener_1_1里设置的交换链,即使在D2D1::BitmapProperties1设置允许Alpha通道(GacUI/Source/NativeWindow/Windows/Direct2D/WinDirect2DApplication.cpp,第242行),貌似也没办法把窗口变透明(试了一下,d2d的bitmap是透明了,但是后面有底色,应该是D3D的);然后尝试在交换链中设置透明,但是报错了,提示说只能在CreateSwapChainForCoreWindow或者WindowCompition才能设置AlphaMode,其两者都是要有窗口扩展样式WS_EX_NOREDIRECTIONBITMAP,该样式不支持win7系统。
from gacui.
from gacui.
非常感谢。
尽管使用DirectComposition可以透明,但是仍然需要win8及以上版本,且要有窗口扩展样式WS_EX_NOREDIRECTIONBITMAP用来设定不使用重定向表面。
这篇文章中 “Window Layering” 似乎容易令人误解。似乎文中没有提到DirectComposition与LayeredWindow的交互方式,且DirectComposition似乎没办法做到和gdi中UpdateLayeredWindow函数所能做到的 “鼠标穿透Alpha为0的区域”的功能。
from gacui.
Related Issues (20)
- C++: error "explicit specialization in non-namespace scope" HOT 10
- 有虚表控件吗 HOT 1
- demo窗口界面的最大化图标错误 HOT 3
- GacGen/NativeController.cpp should be removed from CMakeLists.txt HOT 3
- Window drag to smallest size glich in dpi:125%
- Fix tutorials about setting client size requirement HOT 13
- 界面刷新问题 HOT 7
- 界面缩放异常 HOT 1
- 合成规则 HOT 3
- failed to run GacBuild.ps1 against a commented Resource.xml HOT 1
- 制作自己额外的控件 HOT 2
- Some people like to have preedit support in textbox HOT 1
- ShowModal glitch cause the owner window to suddenly disappear and recover
- Will android and ios support come? HOT 1
- Global keyboard shortcut support
- cubic bezier animation for workflow
- infinite loop of arranger ensurevisible
- click on element of AssociatedHitTestResult="Title" cause window lostfocus HOT 1
- reset selectedItemIndexStart and selectedItemIndexEnd on selection clear
- skip setfocus on focused composition
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gacui.