-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlendEffect.hpp
37 lines (34 loc) · 907 Bytes
/
BlendEffect.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "CanvasEffect.hpp"
namespace AcrylicEverywhere
{
class BlendEffect : public CanvasEffect
{
public:
BlendEffect() : CanvasEffect{ CLSID_D2D1Blend }
{
SetBlendMode();
}
virtual ~BlendEffect() = default;
void SetBlendMode(D2D1_BLEND_MODE blendMode = D2D1_BLEND_MODE_MULTIPLY)
{
SetProperty(D2D1_BLEND_PROP_MODE, BoxValue(blendMode));
}
void SetBackground(const winrt::Windows::Graphics::Effects::IGraphicsEffectSource& source)
{
SetInput(0, source);
}
void SetBackground(const winrt::Windows::UI::Composition::CompositionEffectSourceParameter& source)
{
SetInput(0, source);
}
void SetForeground(const winrt::Windows::Graphics::Effects::IGraphicsEffectSource& source)
{
SetInput(1, source);
}
void SetForeground(const winrt::Windows::UI::Composition::CompositionEffectSourceParameter& source)
{
SetInput(1, source);
}
};
}