26using namespace Gdiplus;
35 Graphics(newImage),
image(newImage),
stream(newStream)
49 auto m =
reinterpret_cast<Metafile**
>(job->
window);
57 auto context =
reinterpret_cast<Graphics*
>(job->
context);
63 IStream *stream = imageGraphics->
stream;
81 HGLOBAL buffer =
nullptr;
82 GetHGlobalFromStream(stream, &buffer);
84 gvwrite(job, (
char*)GlobalLock(buffer), GlobalSize(buffer));
97 HGLOBAL buffer = GlobalAlloc(GMEM_MOVEABLE, 0);
98 IStream *stream =
nullptr;
99 CreateStreamOnHGlobal(buffer, FALSE, &stream);
107 image =
new Metafile (stream,
110 MetafileFrameUnitPixel,
128 MetafileFrameUnitPixel,
130 auto m =
reinterpret_cast<Metafile**
>(job->
window);
132 job->
context =
new Graphics(metafile);
137 Graphics *context = (Graphics *)job->
context;
138 context->SetSmoothingMode(SmoothingModeHighQuality);
139 context->SetTextRenderingHint(TextRenderingHintAntiAlias);
142 context->ResetTransform();
145 context->RotateTransform(-job->
rotation);
153 auto context =
reinterpret_cast<Graphics*
>(job->
context);
156 switch (span->
just) {
165 p.
x -= span->
size.
x / 2.0;
189 vector<PointF> newPoints;
190 for (
int i = 0; i < n; ++i)
191 newPoints.push_back(PointF(
A[i].x, -
A[i].y));
197 auto context =
reinterpret_cast<Graphics *
>(job->
context);
202 context->FillPath(&fill_brush, &pathname);
217 draw_pen.SetDashStyle(DashStyleDash);
220 draw_pen.SetDashStyle(DashStyleDot);
226 context->DrawPath(&draw_pen, &pathname);
232 GraphicsPath pathname;
233 double dx =
A[1].x -
A[0].x;
234 double dy =
A[1].y -
A[0].y;
235 pathname.AddEllipse(RectF(
A[0].x -
dx, -
A[0].y -
dy,
dx * 2.0,
dy * 2.0));
243 GraphicsPath pathname;
244 assert(n <= INT_MAX);
245 pathname.AddPolygon(&
points(
A, n).front(), (
int)n);
253 GraphicsPath pathname;
254 assert(n <= INT_MAX);
255 pathname.AddBeziers(&
points(
A, n).front(), (
int)n);
263 GraphicsPath pathname;
264 assert(n <= INT_MAX);
265 pathname.AddLines(&
points(
A,n).front(), (
int)n);
331 {0,
nullptr, 0,
nullptr,
nullptr}
346 {0,
nullptr, 0,
nullptr,
nullptr}
#define GVRENDER_NO_WHITE_BG
#define GVDEVICE_DOES_TRUECOLOR
#define GVDEVICE_BINARY_FORMAT
#define GVRENDER_DOES_TRANSFORM
#define GVRENDER_Y_GOES_DOWN
size_t gvwrite(GVJ_t *job, const char *s, size_t len)
void SaveBitmapToStream(Bitmap &bitmap, IStream *stream, int format)
const Gdiplus::StringFormat * GetGenericTypographic()
void gdiplus_free_layout(void *layout)
static void gdiplusgen_ellipse(GVJ_t *job, pointf *A, int filled)
static gvdevice_features_t device_features_gdiplus
gvplugin_installed_t gvdevice_gdiplus_types[]
static void gdiplusgen_polyline(GVJ_t *job, pointf *A, size_t n)
static gvrender_engine_t gdiplusgen_engine
static gvdevice_features_t device_features_gdiplus_emf
static void gdiplusgen_end_job(GVJ_t *job)
static gvrender_features_t render_features_gdiplus
static void gdiplusgen_textspan(GVJ_t *job, pointf p, textspan_t *span)
static void gdiplusgen_begin_job(GVJ_t *job)
static void gdiplusgen_path(GVJ_t *job, const GraphicsPath &pathname, int filled)
static void gdiplusgen_begin_page(GVJ_t *job)
static void gdiplusgen_bezier(GVJ_t *job, pointf *A, size_t n, int filled)
static void gdiplusgen_polygon(GVJ_t *job, pointf *A, size_t n, int filled)
gvplugin_installed_t gvrender_gdiplus_types[]
static int layout(graph_t *g, layout_info *infop)
gvplugin_active_device_t device
ImageGraphics(Image *newImage, IStream *newStream)
double yoffset_centerline
void(* free_layout)(void *layout)