1

I am trying to render some primitives using Diret2D(SharpDX), but the result is unsatisfactory for me - all ellipses are fuzzy (see below). Are there some options to make ellipses smoother? I am rendering geometries to BitmapRenderTarget, then receive the Bitmap and do DrawBitmap to the WindowRenderTarget.

Sample

1 Answers1

0

Three years later there still is no answer, so here goes:

Setting anti-aliasing to AntiAliasMode.PerPrimitive will permit lines that are not vertical or horizontal to be drawn without pixellation or jaggedness. This solves the problem for the ellipses, but it does not prevent fuzziness for straight lines.

The OP is referring to the fuzziness that occurs when narrow lines are not aligned with pixel locations, thus cannot be drawn perfectly. A classic observation is that with AntiAliasMode.PerPrimitive a grid with all lines specified to be one pixel thick will appear with some lines wider and some narrower, while with AntiAliasMode.None some lines may vanish altogether.

For vertical and horizontal lines this can be resolved by adding or subtracting 0.5 pixel width to the position of each line. This adjustment will make the lines snap to exact pixel locations so a line of width one can be drawn correctly.

Craig.Feied
  • 2,617
  • 2
  • 16
  • 25