Reputation: 2581
It seems to me that all the effects available in Win2D are for drawing image.
What about CanvasGeometry
? How do I draw a CanvasGeometry
using, say glowing effect ?
Thanks.
Upvotes: 2
Views: 232
Reputation: 32775
Geometry
objects provide a means of drawing and manipulating geometric shapes. It has CreatePolygon
,CreatePath
method could be used to create geometric shapes.
For glowing effect, you could refer this code sample.
private void DoEffect(CanvasDrawingSession ds, Size size, float amount)
{
size.Width = size.Width - ExpandAmount;
size.Height = size.Height - ExpandAmount;
var offset = (float)(ExpandAmount / 2);
using (var textLayout = CreateTextLayout(ds, size))
using (var textCommandList = new CanvasCommandList(ds))
{
using (var textDs = textCommandList.CreateDrawingSession())
{
textDs.DrawTextLayout(textLayout, 0, 0, GlowColor);
}
glowEffectGraph.Setup(textCommandList, amount);
ds.DrawImage(glowEffectGraph.Output, offset, offset);
ds.DrawTextLayout(textLayout, offset, offset, TextColor);
}
}
Upvotes: 1