Added per-pixel alpha blending capability to wxOverlay under wxMSW
By default, wxMSW overlay uses a constant alpha for the window's opacity which can be changed by the added wxOverlay::SetOpacity() function. For some applications, that's all they need. But for others, per-pixel alpha blending is a requirement. This capability can be enabled by calling SetOpacity(-1) before initializing the overlay. But the drawing must be done via a graphics context because the standard DC under MSW does not support alpha drawing. Also request that the overlay window be positioned below any floating windows on the target (if any).
This commit is contained in:
parent
e79466f02b
commit
7b75d0a256
5 changed files with 142 additions and 10 deletions
|
|
@ -34,6 +34,8 @@ public:
|
|||
|
||||
bool IsNative() const;
|
||||
|
||||
void SetOpacity(int alpha);
|
||||
|
||||
private:
|
||||
friend class WXDLLIMPEXP_FWD_CORE wxDCOverlay;
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public:
|
|||
virtual void EndDrawing(wxDC* dc) = 0;
|
||||
virtual void Clear(wxDC* dc) = 0;
|
||||
virtual void Reset() = 0;
|
||||
virtual void SetOpacity(int WXUNUSED(alpha)) { }
|
||||
};
|
||||
|
||||
#endif // _WX_PRIVATE_OVERLAY_H_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue