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.
-
This are aliasing effects, so anti-aliasing is what you want. – AntiHeadshot Nov 13 '15 at 11:37
-
I have set the AntialiasMode = AntialiasMode.PerPrimitive. Now ellipses looks good, but lines are blurry [example](http://i.imgur.com/k39aChA.png?1) – user1500581 Nov 13 '15 at 11:49
-
1Thats the tradeoff you have to take, if your lines are not on pixelperfect positions. – AntiHeadshot Nov 13 '15 at 12:04
-
See my answer here: http://stackoverflow.com/a/10773729/1191082 – Rick Brewster Nov 17 '15 at 21:17
1 Answers
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.

- 2,617
- 2
- 16
- 25