I want to write a parser for svg files and render vector graphics with gdi+, but when I try to inject data from the svg file into the code, turns out to be incorrectly rendered bezier curve. The edges of the curve are uneven. I tried changing the miterlimit values of the SetMiterLimit function of the Pen class, and tried other functions, but nothing changes. I display the image through opengl. For comparison, I'm attaching screenshots: how the curve looks in browsers and in gdi + with and without anti-aliasing. What could be the problem?
svg code:
<path fill="none" stroke="#000000" stroke-width="32" stroke-miterlimit="10" d="M168,37c0,35.4,39.4,64,88,64"/>
c++ code:
Rect paintRect(0, TbHeight, mw->getClRect().right, mw->getClRect().bottom);
Bitmap bmp(paintRect.Width, paintRect.Height - TbHeight);
Graphics* graphics = new Graphics(&bmp);
graphics->SetTextRenderingHint(TextRenderingHintAntiAliasGridFit);
graphics->SetSmoothingMode(SmoothingModeAntiAlias);
float _x = 168;
float _y = 37;
PointF p[] =
{
PointF(_x, _y),
PointF(_x + 0, _y + 35.4),
PointF(_x + 39.4, _y + 64),
PointF(_x + 88, _y + 64)
};
pen.SetWidth(32.f);
graphics->DrawBeziers(&pen, p, 4);
screenshots: svg at browsers without anti-aliasing gdi+ with anti-aliasing gdi+