27using namespace Gdiplus;
36 Graphics(newImage),
image(newImage),
stream(newStream)
50 auto m =
reinterpret_cast<Metafile**
>(job->
window);
58 auto context =
reinterpret_cast<Graphics*
>(job->
context);
64 IStream *stream = imageGraphics->
stream;
82 HGLOBAL buffer =
nullptr;
83 GetHGlobalFromStream(stream, &buffer);
85 gvwrite(job, (
char*)GlobalLock(buffer), GlobalSize(buffer));
98 HGLOBAL buffer = GlobalAlloc(GMEM_MOVEABLE, 0);
99 IStream *stream =
nullptr;
100 CreateStreamOnHGlobal(buffer, FALSE, &stream);
108 image =
new Metafile (stream,
111 MetafileFrameUnitPixel,
129 MetafileFrameUnitPixel,
131 auto m =
reinterpret_cast<Metafile**
>(job->
window);
133 job->
context =
new Graphics(metafile);
138 Graphics *context = (Graphics *)job->
context;
139 context->SetSmoothingMode(SmoothingModeHighQuality);
140 context->SetTextRenderingHint(TextRenderingHintAntiAlias);
143 context->ResetTransform();
146 context->RotateTransform(-job->
rotation);
154 auto context =
reinterpret_cast<Graphics*
>(job->
context);
157 switch (span->
just) {
166 p.
x -= span->
size.
x / 2.0;
192 vector<PointF> newPoints;
193 for (
int i = 0; i < n; ++i)
194 newPoints.push_back(PointF(
d2f(
A[i].x),
d2f(-
A[i].y)));
200 auto context =
reinterpret_cast<Graphics *
>(job->
context);
205 context->FillPath(&fill_brush, &pathname);
220 draw_pen.SetDashStyle(DashStyleDash);
223 draw_pen.SetDashStyle(DashStyleDot);
229 context->DrawPath(&draw_pen, &pathname);
235 GraphicsPath pathname;
236 double dx =
A[1].x -
A[0].x;
237 double dy =
A[1].y -
A[0].y;
247 GraphicsPath pathname;
248 assert(n <= INT_MAX);
249 pathname.AddPolygon(&
points(
A, n).front(), (
int)n);
257 GraphicsPath pathname;
258 assert(n <= INT_MAX);
259 pathname.AddBeziers(&
points(
A, n).front(), (
int)n);
267 GraphicsPath pathname;
268 assert(n <= INT_MAX);
269 pathname.AddLines(&
points(
A,n).front(), (
int)n);
335 {0,
nullptr, 0,
nullptr,
nullptr}
350 {0,
nullptr, 0,
nullptr,
nullptr}
Arithmetic helper functions.
static float d2f(double v)
#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)