Drawing anti-aliased vertical lines using Direct 2D on Windows 10

  antialiasing, c++, direct2d, windows

I am trying to draw anti-aliased vertical lines using Direct 2D on Windows 10.

Specifically, I wish to draw a line that has gradient anti-aliased lines either side. By gradient, I mean that the outer two lines start with a similar colour to the original line, but gradually change colour over the vertical length of the line so that they become the same colour as the background near the end of the original line.

I think I’ve done this is Direct 2D before, but I cannot remember how it’s done. I have tried various permutations of brush opacity and brush width, but I’m not getting anywhere close.

Any ideas are welcome! Thanks

Source: Windows Questions

LEAVE A COMMENT