Skip to content
/ GDC Public

Svg, bitmap and screen based output/render.

Notifications You must be signed in to change notification settings

slidertom/GDC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GDC - Graphical Draw Context

Supported backends:

Compatibility: C++17 standard

Stateless drawings. GDCPaint must be provided for the any drawing function. Similar approach as Skia does. Skia was too heavy and a bit limited due the missed direct svg groups support.

Dependencies:

  • SVG backend contains dependency on the "fstream".
  • HBITMAP, HDC backend contains dependencies on the GDI (oligdi.h wrapper by Olivier Langlois) and GDI+.

Expected usage area: reuse same drawing code for the svg output and on screen drawings.

It's a good replacement for the MFC CDC class. GDC contains similar interface as CDC, but no dependencies on the MFC toolkit. Due the oligdi.h usage GDC performs better than CDC.

Samples:

int32_t nHorzSize = 500;
int32_t nVertSize = 500;
GDCSvg svg(L"test.html", nHorzSize, nVertSize);
GDC gdc(svg);

GDCPaint stroke;
stroke.SetColor(RGB(255, 0, 0));
stroke.SetStrokeType(GDC_PS_DASH);

GDCPaint brush;
brush.SetPaintType(GDC_FILL);
brush.SetColor(RGB(255, 255, 255));

std::vector<GDCPoint> points;
points.push_back(GDCPoint(0,    0));
points.push_back(GDCPoint(100,  0));
points.push_back(GDCPoint(100, 100));
points.push_back(GDCPoint(0, 100));

gdc.DrawPolygon(points, brush, stroke);

About

Svg, bitmap and screen based output/render.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published