mGPlus API Reference  v1.4.0
A MiniGUI component which provides support for advanced 2D graphics functions
mgplus.h
1 /*
2  * \file mgplus.h
3  * \author FMSoft
4  * \date 2008/12/02
5  *
6  * \brief This file includes macro definitions, typedefs and function
7  * interfaces of mGPlus component. mGPlus is an advanced 2D graphics
8  * rendering engine for MiniGUI V3.0 or later.
9  *
10  \verbatim
11 
12  mGPlus is a component that expands and strengthens
13  MiniGUI graphics function. It mainly provides support
14  for 2D vector graphics and advanced graphics algorithm,
15  such as the path, gradient filling, anti-aliases,
16  color composition, and so on.
17 
18  Copyright (C) 2008~2018, Beijing FMSoft Technologies Co., Ltd.
19 
20  This program is free software: you can redistribute it and/or modify
21  it under the terms of the GNU General Public License as published by
22  the Free Software Foundation, either version 3 of the License, or
23  (at your option) any later version.
24 
25  This program is distributed in the hope that it will be useful,
26  but WITHOUT ANY WARRANTY; without even the implied warranty of
27  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28  GNU General Public License for more details.
29 
30  You should have received a copy of the GNU General Public License
31  along with this program. If not, see <http://www.gnu.org/licenses/>.
32 
33  Or,
34 
35  As this program is a library, any link to this program must follow
36  GNU General Public License version 3 (GPLv3). If you cannot accept
37  GPLv3, you need to be licensed from FMSoft.
38 
39  If you have got a commercial license of this program, please use it
40  under the terms and conditions of the commercial license.
41 
42  For more information about the commercial license, please refer to
43  <http://www.minigui.com/en/about/licensing-policy/>.
44 
45  \endverbatim
46  */
47 
48 
55 #ifndef _MGPLUS_H
56 #define _MGPLUS_H
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif /* __cplusplus */
61 
62 #include <minigui/common.h>
63 #include <minigui/minigui.h>
64 #include <minigui/gdi.h>
65 #include <minigui/fixedmath.h>
66 
67 #ifndef MGPLUS_MAJOR_VERSION
68 # undef PACKAGE
69 # undef VERSION
70 # undef PACKAGE_BUGREPORT
71 # undef PACKAGE_NAME
72 # undef PACKAGE_STRING
73 # undef PACKAGE_TARNAME
74 # undef PACKAGE_VERSION
75 # ifdef __MGPLUS_LIB__
76 # if defined(__CMAKE_PROJECT__) || defined(WIN32)
77 # include "mgplusconfig.h"
78 # else
79 # include "../mgplusconfig.h"
80 # endif
81 # else
82 # include "mgplusconfig.h"
83 # endif
84 #endif
85 
86 #if defined (WIN32) && !defined(__NODLL__)
87  #if defined (__MGPLUS_LIB__)
88  #define MGPLUS_EXPORT __declspec(dllexport)
89  #else
90  #define MGPLUS_EXPORT __declspec(dllimport)
91  #endif
92 #else
93  #define MGPLUS_EXPORT
94 #endif
95 
101 #define MP_INV_HANDLE 0
102 
108 typedef DWORD HGRAPHICS;
109 
115 typedef DWORD HPATH;
116 
122 typedef DWORD HBRUSH;
123 
129 typedef DWORD HPEN;
130 
136 typedef DWORD HFONT;
137 
143 typedef DWORD ARGB;
144 
148 typedef struct _MPPOINT
149 {
150  float x;
151  float y;
152 }MPPOINT;
153 
158 typedef enum _MPStatus
159 {
160  MP_OK = 0,
161  MP_GENERIC_ERROR = 1,
162  MP_INVALID_PARAMETER = 2,
163  MP_OUT_OF_MEMORY = 3,
164  MP_INDEX_NOT_MATCH = 4,
165  MP_NOT_ENOUGH_FIGURE_MEMORY = 5,
166  MP_NOT_IMPLEMENTED = 6,
167  MP_NOT_INITIALIZED = 7,
168  MP_ABORTED = 8,
169  MP_FILE_NOT_FOUNT = 9,
170  MP_VALUE_OVERFLOW = 10,
171  MP_ACCESS_DENIED = 11,
172  MP_UNKNOWN_IMAGE_FORMAT = 12,
173  MP_FONT_FAMILY_NOT_FOUND = 13,
174  MP_FONT_STYLE_NOT_FOUND = 14,
175  MP_NOT_TRUETYPE_FONT = 15,
176  MP_UNSUPPORTED_VERSION = 16
177 }MPStatus;
178 
183 typedef enum _MPSmoothingMode
184 {
185  /* Smoothing mode with speed.*/
186  MP_SMOOTHING_SPEED = 0,
187  /* Smoothing mode with quality.*/
188  MP_SMOOTHING_QUALITY = 1,
190 
191 
196 typedef enum _MPGlyphRendering
197 {
198  /* retrieves the glyph bitmap direct from ft2. */
199  MP_GLYPH_REN_NATIVE_MONO,
200  MP_GLYPH_REN_NATIVE_GRAY8,
201  /* retrieves the curve data points in the rasterizer's native
202  * format and uses the font's design units.
203  */
204  MP_GLYPH_REN_OUTLINE,
205  /* retrieves the glyph bitmap from agg render. */
206  MP_GLYPH_REN_AGG_MONO,
207  MP_GLYPH_REN_AGG_GRAY8,
209 
214 typedef enum _PATH_VERTEX_COMMANDS
215 {
216  PATH_CMD_STOP = 0,
217  PATH_CMD_MOVE_TO = 1,
218  PATH_CMD_LINE_TO = 2,
219  PATH_CMD_CURVE3 = 3,
220  PATH_CMD_CURVE4 = 4,
221  PATH_CMD_CURVEN = 5,
222  PATH_CMD_CATROM = 6,
223  PATH_CMD_UBSPLINE = 7,
224  PATH_CMD_END_POLY = 0x0F,
225  PATH_CMD_MASK = 0x0F
227 
232 typedef enum _MPOrientation
233 {
234  MP_ORIENTATION_CW = 0,
235  MP_ORIENTATION_CCW
237 
242 typedef enum _MPCompositingMode
243 {
244  /* Porter-Duff Clear rule. Both the color and the alpha of the
245  * destination are cleared. Neither the source nor the
246  * destination is used as input.
247  */
248  MP_COMP_OP_CLEAR = 0,
249  /* Porter-Duff Source rule. The source is copied to the destination.
250  * The destination is not used as input.
251  */
252  MP_COMP_OP_SRC,
253  /* Porter-Duff Destination rule, The destination is left untouched.
254  */
255  MP_COMP_OP_DST,
256  /* Porter-Duff Source Over Destination rule. The source is composited
257  * over the destination.
258  */
259  MP_COMP_OP_SRC_OVER,
260  /* Porter-Duff Destination Over Source rule. The destination is composited
261  * over the source and the result replaces the destination.
262  */
263  MP_COMP_OP_DST_OVER,
264  /* Porter-Duff Source In Destination rule.The part of the source lying
265  * inside of the destination replaces the destination.
266  */
267  MP_COMP_OP_SRC_IN,
268  /* Porter-Duff Destination In Source rule. The part of the destination lying
269  * inside of the source replaces the destination.
270  */
271  MP_COMP_OP_DST_IN,
272  /* Porter-Duff Source Held Out By Destination rule. The part of the source
273  * lying outside of the destination replaces the destination.
274  */
275  MP_COMP_OP_SRC_OUT,
276  /* Porter-Duff Destination Held Out By Source rule. The part of the
277  * destination lying outside of the source replaces the destination.
278  */
279  MP_COMP_OP_DST_OUT,
280  /* Porter-Duff Source Atop Destination rule, The part of the source
281  * lying inside of the destination is composited onto the destination .
282  */
283  MP_COMP_OP_SRC_ATOP,
284  /* Porter-Duff Destination Atop Source rule The part of the destination
285  * lying inside of the source is composited over the source and replaces
286  * the destination ().
287  */
288  MP_COMP_OP_DST_ATOP,
289  /* Porter-Duff Source Xor Destination rule, The part of the source that lies
290  * outside of the destination is combined with the part of the destination
291  * that lies outside of the source.
292  */
293  MP_COMP_OP_XOR,
295 
300 typedef enum _MPInterpolationMode
301 {
302  MP_INTERPOLATION_MODE_INVALID = -1, //reserved
303  MP_INTERPOLATION_MODE_DEFAULT = 0, //reserved
304  MP_INTERPOLATION_MODE_LOW_QUALITY = 1, //reserved
305  MP_INTERPOLATION_MODE_HIGH_QUALITY = 2, //reserved
306  MP_INTERPOLATION_MODE_PERSPECTIVE,
307  MP_INTERPOLATION_MODE_BILINEAR,
308  MP_INTERPOLATION_MODE_AFFINE,
309  MP_INTERPOLATION_MODE_BICUBIC, //reserved
310  MP_INTERPOLATION_MODE_NEARESTNEIGHBOR, //reserved
311  MP_INTERPOLATION_MODE_HIGH_QUALITY_BILINEAR, //reserved
312  MP_INTERPOLATION_MODE_HIGH_QUALITY_BICUBIC //reserved
314 
319 typedef enum _MPRenderingControl
320 {
321  MP_RENDER_SPEED = 0,
322  MP_RENDER_QUALITY = 1,
324 
329 typedef enum _MPTextRenderingHint
330 {
331  MP_TEXT_RENDER_HINT_ANTIALIAS_ON = 0,
332  MP_TEXT_RENDER_HINT_ANTIALIAS_OFF = 1,
334 
339 typedef enum _MPPathRenderingHint
340 {
341  MP_PATH_RENDER_HINT_ANTIALIAS_ON = 0,
342  MP_PATH_RENDER_HINT_ANTIALIAS_OFF = 1,
344 
348 typedef struct _MPMatrix
349 {
350  /* transformation matrix.
351  * [ sx , shy, 0]
352  * | shx, sy, 0]
353  * [ tx, ty, 0]
354  */
355  double sx, shy, shx, sy, tx, ty;
356 }MPMatrix;
357 
361 typedef struct _GLYPHMETRICS {
362  /* Specifies the x- and y-coordinates of the upper left
363  * corner of the smallest rectangle that completely encloses the glyph.
364  */
365  unsigned char bbox_x;
366  unsigned char bbox_y;
367  /* Specifies the width of the smallest rectangle that
368  * completely encloses the glyph (its box).
369  */
370  unsigned char bbox_w;
371  unsigned char bbox_h;
372  /* Specifies the horizontal/vertical distance from the origin of the current
373  * character cell to the origin of the next character cell.
374  */
375  short adv_x;
376  short adv_y;
378 
383 typedef enum _GLYPH_DATE_TYPE
384 {
385  GLYPH_DATA_INVALID = 0,
386  /* glyph is monochrome.*/
387  GLYPH_DATA_MONO,
388  /* glyph is anti-aliasing.*/
389  GLYPH_DATA_GRAY8,
390  /* glyph is outline.*/
391  GLYPH_DATA_OUTLINE
393 
397 typedef struct _GLYPHDATA
398 {
399  /* glyph index of ttf font.*/
400  unsigned int glyph_index;
401  /* glyph render data.*/
402  BYTE* data;
403  unsigned int data_size;
404  GLYPH_DATE_TYPE data_type;
406 
411 typedef enum _MPFillMode
412 {
413  /* non zero fill mode.*/
414  MP_PATH_FILL_MODE_WINDING=0,
415  /* odd fill mode.*/
416  MP_PATH_FILL_MODE_ALTERNATE,
417 }MPFillMode;
418 
423 typedef enum _LINE_CAP_E
424 {
425  /*
426  * Indicates a flat line cap style. See the class overview for an
427  * illustration.
428  */
429  CAP_BUTT = 0,
430  /*
431  * Indicates a rounded line cap style. See the class overview for an
432  * illustration.
433  */
434  CAP_ROUND = 1,
435  /*
436  * Indicates a square line cap style. See the class overview for an
437  * illustration.
438  */
439  CAP_SQUARE = 2,
440 }LINE_CAP_E;
441 
446 typedef enum _LINE_JOIN_E
447 {
448  /*
449  * Indicates a mitered line join style.
450  */
451  JOIN_MITER = 0,
452  /*
453  * Indicates a rounded line join style.
454  */
455  JOIN_ROUND = 1,
456  /*
457  * Indicates a bevelled line join style.
458  */
459  JOIN_BEVEL = 2,
460  /* reseverd,not used now, but surport by mgplus.*/
461  JOIN_MILTER_REVERT = 3,
462  JOIN_MILTER_ROUND = 4
463 }LINE_JOIN_E;
464 
469 typedef enum _MPBrushType
470 {
471  /* Brush the path with the single color.*/
472  MP_BRUSH_TYPE_SOLIDCOLOR = 0,
473  /* Brush the path with the hatchfill.*/
474  MP_BRUSH_TYPE_HATCHFILL = 1,
475  /* Brush the path with the texturefill.*/
476  MP_BRUSH_TYPE_TEXTUREFILL = 2,
477  /* Brush the path with the path gradient.*/
478  MP_BRUSH_TYPE_PATHGRADIENT = 3,
479  /* Brush the path with linear gradient.*/
480  MP_BRUSH_TYPE_LINEARGRADIENT
481 }MPBrushType;
482 
487 typedef enum _MPLinearGradientMode
488 {
489  /* gradient horizontal.*/
490  MP_LINEAR_GRADIENT_MODE_HORIZONTAL = 0,
491  /* gradient vertica.*/
492  MP_LINEAR_GRADIENT_MODE_VERTICAL,
493  /* gradient forwarddiagonal.*/
494  MP_LINEAR_GRADIENT_MODE_FORWARDDIAGONAL,
495  /* gradient backwarddiagonal.*/
496  MP_LINEAR_GRADIENT_MODE_BACKWARDDIAGONAL
498 
522 MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreateFromDC (HDC hdc);
523 
537 MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreateWithoutCanvas(HDC hdc);
538 
551 MGPLUS_EXPORT HDC MGPlusGetGraphicDC (HGRAPHICS graphic);
552 
566 MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreate (int width, int height);
567 
581 MGPLUS_EXPORT int MGPlusSaveHG (HGRAPHICS hg);
582 
602 MGPLUS_EXPORT BOOL MGPlusRestoreHG (HGRAPHICS hg, int saved_hg);
603 
626 MGPLUS_EXPORT MPStatus MGPlusGraphicCopyFromDC (HGRAPHICS graphic, HDC hdc, int sx,
627  int sy, int sw, int sh, int dx, int dy);
628 
642 MGPLUS_EXPORT MPStatus MGPlusGraphicCopy (HGRAPHICS src_gs, HGRAPHICS dst_gs);
643 
657 MGPLUS_EXPORT MPStatus MGPlusGraphicBlend (HGRAPHICS src_gs, HGRAPHICS dst_gs);
658 
673 MGPLUS_EXPORT MPStatus MGPlusGraphicClearEx (HGRAPHICS graphics, RECT* rect, ARGB color);
674 
675 #define MGPlusGraphicClear(graphics, color) MGPlusGraphicClearEx (graphics, NULL, color)
676 
702 MGPLUS_EXPORT MPStatus MGPlusGraphicSave (HGRAPHICS graphics, HDC hdc,
703  int sx, int sy, int sw, int sh, int dx, int dy);
704 
717 MGPLUS_EXPORT MPStatus MGPlusGraphicDelete (HGRAPHICS graphics);
718 
743 MGPLUS_EXPORT MPStatus MGPlusSetCompositingMode (HGRAPHICS graphics,
744  MPCompositingMode composite_mode);
745 
760 MGPLUS_EXPORT MPStatus MGPlusGetCompositingMode (HGRAPHICS graphics,
761  MPCompositingMode* composite_mode);
762 
787 MGPLUS_EXPORT MPStatus MGPlusGetSmoothingMode (HGRAPHICS graphics, MPSmoothingMode* value);
788 
803 MGPLUS_EXPORT MPStatus MGPlusSetSmoothingMode (HGRAPHICS graphics, MPSmoothingMode value);
804 
819 MGPLUS_EXPORT MPStatus MGPlusSetPathRenderingHint (HGRAPHICS graphics,
820  MPPathRenderingHint value);
821 
836 MGPLUS_EXPORT MPStatus MGPlusGetPathRenderingHint (HGRAPHICS graphics,
837  MPPathRenderingHint* value);
838 
853 MGPLUS_EXPORT MPStatus MGPlusSetTextRenderingHint (HGRAPHICS graphics,
854  MPTextRenderingHint value);
855 
871 MGPLUS_EXPORT MPStatus MGPlusGetTextRenderingHint (HGRAPHICS graphics,
872  MPTextRenderingHint* value);
873 
888 MGPLUS_EXPORT MPStatus MGPlusSetInterpolationMode (HGRAPHICS graphics,
889  MPInterpolationMode mode);
890 
905 MGPLUS_EXPORT MPStatus MGPlusGetInterpolationMode (HGRAPHICS graphics,
906  MPInterpolationMode* mode);
907 
932 MGPLUS_EXPORT MPStatus MGPlusSetWorldTransform (HGRAPHICS graphics,
933  MPMatrix *matrix);
934 
950 MGPLUS_EXPORT MPStatus MGPlusWorldTransform (HGRAPHICS graphics, MPMatrix *matrix);
951 
967 MGPLUS_EXPORT MPStatus MGPlusGetWorldTransform (HGRAPHICS graphics, MPMatrix *matrix);
968 
981 MGPLUS_EXPORT MPStatus MGPlusResetWorldTransform (HGRAPHICS graphics);
982 
998 MGPLUS_EXPORT MPStatus MGPlusTranslateWorldTransform (HGRAPHICS graphics,
999  float dx, float dy);
1000 
1016 MGPLUS_EXPORT MPStatus MGPlusScaleWorldTransform (HGRAPHICS graphics,
1017  float sx, float sy);
1018 
1033 MGPLUS_EXPORT MPStatus MGPlusRotateWorldTransform (HGRAPHICS graphics,
1034  float angle);
1035 
1046 MGPLUS_EXPORT MPStatus MGPlusPathTransform (HPATH path);
1047 
1076 MGPLUS_EXPORT MPStatus MGPlusDrawLine (HGRAPHICS graphics, HPEN pen,
1077  float x1, float y1, float x2, float y2);
1078 
1097 MGPLUS_EXPORT MPStatus MGPlusDrawLineI (HGRAPHICS graphics, HPEN pen,
1098  int x1, int y1, int x2, int y2);
1099 
1124 MGPLUS_EXPORT MPStatus MGPlusDrawArc (HGRAPHICS graphics, HPEN pen,
1125  float x, float y, float width, float height, float startangle,
1126  float sweepangle);
1127 
1150 MGPLUS_EXPORT MPStatus MGPlusDrawArcI (HGRAPHICS graphics, HPEN pen,
1151  int x, int y, int width, int height, float startAngle,
1152  float sweepAngle);
1153 
1178 MGPLUS_EXPORT MPStatus MGPlusFillArc (HGRAPHICS graphics, HBRUSH brush,
1179  float x, float y, float width, float height, float startangle,
1180  float sweepangle);
1181 
1204 MGPLUS_EXPORT MPStatus MGPlusFillArcI (HGRAPHICS graphics, HBRUSH brush,
1205  int x, int y, int width, int height, float startAngle,
1206  float sweepAngle);
1207 
1232 MGPLUS_EXPORT MPStatus MGPlusDrawBezier (HGRAPHICS graphics, HPEN pen,
1233  float x1, float y1, float x2, float y2, float x3, float y3,
1234  float x4, float y4);
1235 
1258 MGPLUS_EXPORT MPStatus MGPlusDrawBezierI (HGRAPHICS graphics, HPEN pen,
1259  int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
1260 
1285 MGPLUS_EXPORT MPStatus MGPlusFillBezier (HGRAPHICS graphics, HBRUSH brush,
1286  float x1, float y1, float x2, float y2, float x3, float y3,
1287  float x4, float y4);
1288 
1311 MGPLUS_EXPORT MPStatus MGPlusFillBezierI (HGRAPHICS graphics, HBRUSH brush,
1312  int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4);
1313 
1332 MGPLUS_EXPORT MPStatus MGPlusFillRectangle (HGRAPHICS graphics, HBRUSH brush,
1333  float x, float y, float width, float height);
1334 
1353 MGPLUS_EXPORT MPStatus MGPlusFillRectangleI (HGRAPHICS graphics, HBRUSH brush,
1354  int x, int y, int width, int height);
1355 
1374 MGPLUS_EXPORT MPStatus MGPlusDrawRectangle (HGRAPHICS graphics, HPEN pen,
1375  float x, float y, float width, float height);
1376 
1395 MGPLUS_EXPORT MPStatus MGPlusDrawRectangleI (HGRAPHICS graphics, HPEN pen,
1396  int x, int y, int width, int height);
1397 
1416 MGPLUS_EXPORT MPStatus MGPlusFillRectangle (HGRAPHICS graphics, HBRUSH brush,
1417  float x, float y, float width, float height);
1418 
1437 MGPLUS_EXPORT MPStatus MGPlusFillRectangleI (HGRAPHICS graphics, HBRUSH brush,
1438  int x, int y, int width, int height);
1439 
1460 MGPLUS_EXPORT MPStatus MGPlusDrawRoundRectEx (HGRAPHICS graphics, HPEN pen,
1461  float x, float y, float width, float height, float rx, float ry);
1462 
1463 #define MGPlusDrawRoundRect(graphics, pen, x, y, width, height, r) \
1464  MGPlusDrawRoundRectEx (graphics, pen, x, y, width, height, r, r)
1465 
1486 MGPLUS_EXPORT MPStatus MGPlusDrawRoundRectIEx (HGRAPHICS graphics, HPEN pen,
1487  int x, int y, int width, int height, int rx, int ry);
1488 
1489 #define MGPlusDrawRoundRectI(graphics, pen, x, y, width, height, r) \
1490  MGPlusDrawRoundRectIEx (graphics, pen, x, y, width, height, r, r)
1491 
1512 MGPLUS_EXPORT MPStatus MGPlusFillRoundRectEx (HGRAPHICS graphics, HBRUSH brush,
1513  float x, float y, float width, float height, float rx, float ry);
1514 
1515 #define MGPlusFillRoundRect(graphics, brush, x, y, width, height, r) \
1516  MGPlusFillRoundRectEx (graphics, brush, x, y, width, height, r, r)
1517 
1538 MGPLUS_EXPORT MPStatus MGPlusFillRoundRectIEx (HGRAPHICS graphics, HBRUSH brush,
1539  int x, int y, int width, int height, int rx, int ry);
1540 
1541 #define MGPlusFillRoundRectI(graphics, brush, x, y, width, height, r) \
1542  MGPlusFillRoundRectIEx (graphics, brush, x, y, width, height, r, r)
1543 
1562 MGPLUS_EXPORT MPStatus MGPlusDrawEllipse (HGRAPHICS graphics, HPEN pen,
1563  float cx, float cy, float rx, float ry);
1564 
1584 MGPLUS_EXPORT MPStatus MGPlusDrawEllipseI (HGRAPHICS graphics, HPEN pen,
1585  int cx, int cy, int rx, int ry);
1586 
1605 MGPLUS_EXPORT MPStatus MGPlusFillEllipse (HGRAPHICS graphics, HBRUSH brush,
1606  float cx, float cy, float rx, float ry);
1607 
1627 MGPLUS_EXPORT MPStatus MGPlusFillEllipseI (HGRAPHICS graphics, HBRUSH brush,
1628  int cx, int cy, int rx, int ry);
1629 
1645 MGPLUS_EXPORT MPStatus MGPlusSetClipPath (HGRAPHICS graphics, HPATH path);
1646 
1663 MGPLUS_EXPORT MPStatus MGPlusFillPath (HGRAPHICS graphics, HBRUSH brush,
1664  HPATH path);
1665 
1682 MGPLUS_EXPORT MPStatus MGPlusDrawPath (HGRAPHICS graphics, HPEN pen,
1683  HPATH path);
1684 
1701 MGPLUS_EXPORT MPStatus MGPlusGraphicLoadBitmap (HGRAPHICS graphics, int n_index,
1702  PBITMAP p_bitmap);
1703 
1720 MGPLUS_EXPORT MPStatus MGPlusGraphicLoadBitmapFromFile (HGRAPHICS graphics,
1721  int n_index, char* file);
1722 
1738 MGPLUS_EXPORT MPStatus MGPlusGraphicUnLoadBitmap (HGRAPHICS graphics, int n_index);
1739 
1755 MGPLUS_EXPORT PBITMAP MGPlusGraphicGetBitmap (HGRAPHICS graphics, int n_index);
1756 
1771 MGPLUS_EXPORT MPStatus MGPlusSetImageAlpha (HGRAPHICS graphics, int alpha);
1772 
1787 MGPLUS_EXPORT MPStatus MGPlusGetImageAlpha (HGRAPHICS graphics, int* alpha);
1788 
1805 MGPLUS_EXPORT MPStatus MGPlusDrawImageWithPoints (HGRAPHICS graphics,
1806  int n_index, const MPPOINT* point, int count);
1807 
1831 MGPLUS_EXPORT MPStatus MGPlusDrawImage (HGRAPHICS graphics, int n_index,
1832  int x, int y, int w, int h);
1833 
1850 MGPLUS_EXPORT MPStatus MGPlusDrawImageWithPath (HGRAPHICS graphics,
1851  int n_index, HPATH path);
1852 
1875 MGPLUS_EXPORT HPATH MGPlusPathCreate (MPFillMode brushMode);
1876 
1889 MGPLUS_EXPORT MPStatus MGPlusPathDelete (HPATH path);
1890 
1901 MGPLUS_EXPORT MPStatus MGPlusPathReset (HPATH path);
1902 
1914 MGPLUS_EXPORT MPStatus MGPlusPathSetAllOrientation (HPATH path,
1915  MPOrientation orientation);
1916 
1932 MGPLUS_EXPORT MPStatus MGPlusPathGetVertex (HPATH path, int idx,
1933  double* x, double* y, int* cmd);
1934 
1946 MGPLUS_EXPORT MPStatus MGPlusPathGetPointCount (HPATH path, int* count);
1947 
1960 MGPLUS_EXPORT MPStatus MGPlusPathGetPoints (HPATH path, int* count, MPPOINT** pt);
1961 
1980 MGPLUS_EXPORT MPStatus MGPlusPathAddLine (HPATH path, float x1, float y1,
1981  float x2, float y2);
1982 
2001 MGPLUS_EXPORT MPStatus MGPlusPathAddLineI (HPATH path, int x1, int y1,
2002  int x2, int y2);
2003 
2020 MGPLUS_EXPORT MPStatus MGPlusPathAddLines (HPATH path, const MPPOINT* points,
2021  int count);
2022 
2043 MGPLUS_EXPORT MPStatus MGPlusPathAddArc (HPATH path, float cx, float cy, float rx,
2044  float ry, float startAngle, float sweepAngle);
2045 
2066 MGPLUS_EXPORT MPStatus MGPlusPathAddArcI (HPATH path, int cx, int cy,
2067  int rx, int ry, int startAngle, int sweepAngle);
2068 
2091 MGPLUS_EXPORT MPStatus MGPlusPathAddBezier (HPATH path, float x1, float y1,
2092  float x2, float y2, float x3, float y3, float x4, float y4);
2093 
2116 MGPLUS_EXPORT MPStatus MGPlusPathAddBezierI (HPATH path, int x1, int y1,
2117  int x2, int y2, int x3, int y3, int x4, int y4);
2118 
2139 MGPLUS_EXPORT MPStatus MGPlusPathAddRoundRectEx (HPATH path, int x, int y,
2140  int width, int height, int rx, int ry);
2141 
2142 #define MGPlusPathAddRoundRect(path, x, y, width, height, r) \
2143  MGPlusPathAddRoundRectEx (path, x, y, width, height, r, r)
2144 
2177 MGPLUS_EXPORT MPStatus MGPlusPathArcto (HPATH path, double x1, double y1,
2178  double x2, double y2, double radius);
2179 
2202 MGPLUS_EXPORT MPStatus MGPlusPathArctoI (HPATH path, int x1, int y1,
2203  int x2, int y2, int radius);
2204 
2220 MGPLUS_EXPORT MPStatus MGPlusPathMoveto (HPATH path, float x, float y);
2221 
2237 MGPLUS_EXPORT MPStatus MGPlusPathMovetoI (HPATH path, int x, int y);
2238 
2254 MGPLUS_EXPORT MPStatus MGPlusPathLineto (HPATH path, float x, float y);
2255 
2271 MGPLUS_EXPORT MPStatus MGPlusPathLinetoI (HPATH path, int x, int y);
2272 
2294 MGPLUS_EXPORT MPStatus MGPlusPathBezierto (HPATH path, float x1, float y1,
2295  float x2, float y2, float x3, float y3);
2296 
2318 MGPLUS_EXPORT MPStatus MGPlusPathBeziertoI (HPATH path, int x1, int y1,
2319  int x2, int y2, int x3, int y3);
2320 
2340 MGPLUS_EXPORT MPStatus MGPlusPathQuadraticto (HPATH path, float x1,
2341  float y1, float x2, float y2);
2342 
2362 MGPLUS_EXPORT MPStatus MGPlusPathQuadratictoI (HPATH path, int x1,
2363  int y1, int x2, int y2);
2364 
2383 MGPLUS_EXPORT MPStatus MGPlusPathAddRectangle (HPATH path, float x, float y,
2384  float width, float height);
2385 
2404 MGPLUS_EXPORT MPStatus MGPlusPathAddRectangleI (HPATH path, int x, int y,
2405  int width, int height);
2406 
2426 MGPLUS_EXPORT MPStatus MGPlusPathAddEllipse (HPATH path, float cx, float cy,
2427  float rx, float ry, BOOL clockwise);
2428 
2448 MGPLUS_EXPORT MPStatus MGPlusPathAddEllipseI (HPATH path, int cx, int cy,
2449  int rx, int ry, BOOL clockwise);
2450 
2465 MGPLUS_EXPORT MPStatus MGPlusPathAddCurve (HPATH path, const MPPOINT* points,
2466  int count);
2467 
2480 MGPLUS_EXPORT MPStatus MGPlusPathAddPath (HPATH path, HPATH add_path);
2481 
2494 MGPLUS_EXPORT MPStatus MGPlusPathStartFigure (HPATH path);
2495 
2508 MGPLUS_EXPORT MPStatus MGPlusPathCloseFigure (HPATH path);
2509 
2521 MGPLUS_EXPORT MPStatus MGPlusPathRotateAroundPoint (HPATH path,
2522  const MPPOINT* pt, float angle);
2523 
2533 MGPLUS_EXPORT MPStatus MGPlusPathSetTransform (HPATH path, MPMatrix* matrix);
2534 
2546 MGPLUS_EXPORT MPStatus MGPlusPathGetTransform (HPATH path, MPMatrix* matrix);
2547 
2556 MGPLUS_EXPORT MPStatus MGPlusPathResetTransform (HPATH path);
2557 
2569 MGPLUS_EXPORT MPStatus MGPlusPathScale(HPATH path, float sx, float sy);
2570 
2580 MGPLUS_EXPORT MPStatus MGPlusPathRotate (HPATH path, float angle);
2581 
2592 MGPLUS_EXPORT MPStatus MGPlusPathTranslate(HPATH path, float dx, float dy);
2593 
2617 MGPLUS_EXPORT HPEN MGPlusPenCreate (int width, ARGB rgba);
2618 
2632 MGPLUS_EXPORT MPStatus MGPlusPenSetColor (HPEN pen, ARGB rgba);
2633 
2647 MGPLUS_EXPORT MPStatus MGPlusPenSetJoinStyle (HPEN pen, LINE_JOIN_E line_join);
2648 
2662 MGPLUS_EXPORT MPStatus MGPlusPenSetCapStyle (HPEN pen, LINE_CAP_E line_cap);
2663 
2680 MGPLUS_EXPORT MPStatus MGPlusPenSetDashes (HPEN pen, int dash_phase,
2681  const unsigned char* dash_list, int dash_len);
2682 
2696 MGPLUS_EXPORT MPStatus MGPlusPenSetWidth (HPEN pen, int width);
2697 
2710 MGPLUS_EXPORT MPStatus MGPlusPenDelete (HPEN pen);
2711 
2734 MGPLUS_EXPORT HBRUSH MGPlusBrushCreate (MPBrushType type);
2735 
2748 MGPLUS_EXPORT MPStatus MGPlusBrushDelete (HBRUSH brush);
2749 
2761 MGPLUS_EXPORT MPStatus MGPlusSetSolidBrushColor (HBRUSH brush, ARGB rgba);
2762 
2774 MPStatus MGPlusGetSolidBrushColor (HBRUSH brush, ARGB* rgba);
2775 
2789 MGPLUS_EXPORT MPStatus MGPlusSetTextureBrushImage (HBRUSH brush,
2790  BITMAP* bitmap);
2791 
2807 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterPoint (HBRUSH brush,
2808  MPPOINT* point);
2809 
2824 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterColor (HBRUSH brush,
2825  ARGB rgba);
2826 
2842 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundColors (HBRUSH brush,
2843  ARGB* rgba, int count);
2844 
2860 MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundRect (HBRUSH brush,
2861  RECT* rect);
2862 
2878 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushMode (HBRUSH brush,
2879  MPLinearGradientMode mode);
2880 
2894 MGPLUS_EXPORT MPStatus MGPlusGetLinearGradientBrushMode (HBRUSH brush,
2895  MPLinearGradientMode* mode);
2896 
2910 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushRect (HBRUSH brush, RECT* rect);
2911 
2926 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColors (HBRUSH brush,
2927  ARGB* colors, int count);
2928 
2945 MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColorsEx (HBRUSH brush,
2946  ARGB* colors, int count, float* position);
2947 
2948 
2963 MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushGetColors (HBRUSH brush, ARGB* color,
2964  float* position);
2965 
2978 MGPLUS_EXPORT int MGPlusLinearGradientBrushGetColorNumber (HBRUSH brush);
2979 
2994 MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushAddColor (HBRUSH brush,
2995  ARGB color, float position);
2996 
3024 MGPLUS_EXPORT HFONT MGPlusCreateFont (const char* font_name,
3025  unsigned face_index, MPGlyphRendering ren_type,
3026  unsigned int width, unsigned int height, BOOL flip_y);
3027 
3038 MGPLUS_EXPORT MPStatus MGPlusDeleteFont (HFONT hfont);
3039 
3052 MGPLUS_EXPORT HPATH MGPlusGetGlyphPath (int x, int y, LPGLYPHDATA lpdata);
3053 
3068 MGPLUS_EXPORT MPStatus MGPlusGetGlyphOutline (HFONT hfont, unsigned uchar,
3069  LPGLYPHMETRICS lpgm, LPGLYPHDATA lpdata);
3070 
3089 MGPLUS_EXPORT MPStatus MGPlusDrawGlyph (HGRAPHICS graphics, HFONT hfont,
3090  int x, int y, LPGLYPHDATA lpdata, ARGB color);
3091 
3109 MGPLUS_EXPORT BOOL MGPlusRegisterFashionLFRDR (void);
3110 
3118 MGPLUS_EXPORT BOOL MGPlusUnregisterFashionLFRDR (void);
3119 
3120 
3124 #ifdef __cplusplus
3125 }
3126 #endif /* __cplusplus */
3127 
3128 #endif
struct _GLYPHDATA GLYPHDATA
enum _LINE_CAP_E LINE_CAP_E
Linear mode.
MGPLUS_EXPORT MPStatus MGPlusPathAddBezier(HPATH path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Add a bezier to the path .
MGPLUS_EXPORT MPStatus MGPlusPathAddRectangleI(HPATH path, int x, int y, int width, int height)
Add a rectangle to the path.
MGPLUS_EXPORT MPStatus MGPlusSetWorldTransform(HGRAPHICS graphics, MPMatrix *matrix)
Set the world transform of graphic.
MGPLUS_EXPORT MPStatus MGPlusFillRoundRectIEx(HGRAPHICS graphics, HBRUSH brush, int x, int y, int width, int height, int rx, int ry)
Draw a round rect on the graphic.
MGPLUS_EXPORT MPStatus MGPlusFillEllipseI(HGRAPHICS graphics, HBRUSH brush, int cx, int cy, int rx, int ry)
Draw a ellipse on the graphic.
MGPLUS_EXPORT HPEN MGPlusPenCreate(int width, ARGB rgba)
Create a pen.
MGPLUS_EXPORT MPStatus MGPlusPathAddLines(HPATH path, const MPPOINT *points, int count)
Add a series lines to a path.
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterPoint(HBRUSH brush, MPPOINT *point)
Set the center point with path gradient brush.
MGPLUS_EXPORT MPStatus MGPlusDrawEllipseI(HGRAPHICS graphics, HPEN pen, int cx, int cy, int rx, int ry)
Draw a ellipse on the graphic.
struct _GLYPHMETRICS GLYPHMETRICS
MGPLUS_EXPORT MPStatus MGPlusGetCompositingMode(HGRAPHICS graphics, MPCompositingMode *composite_mode)
Get the compositing mode of graphic.
MGPLUS_EXPORT HPATH MGPlusGetGlyphPath(int x, int y, LPGLYPHDATA lpdata)
Get the Glyph outline path.
MGPLUS_EXPORT MPStatus MGPlusDrawLine(HGRAPHICS graphics, HPEN pen, float x1, float y1, float x2, float y2)
Draw a line on the graphic.
MGPLUS_EXPORT MPStatus MGPlusDrawPath(HGRAPHICS graphics, HPEN pen, HPATH path)
Draw the path with a pen on the graphic.
MGPLUS_EXPORT MPStatus MGPlusResetWorldTransform(HGRAPHICS graphics)
Reset the world transform of graphic.
MGPLUS_EXPORT BOOL MGPlusUnregisterFashionLFRDR(void)
Unregisters the Fashion LFRDR.
MGPLUS_EXPORT MPStatus MGPlusPathLineto(HPATH path, float x, float y)
Line the path to a new point.
enum _MPLinearGradientMode MPLinearGradientMode
Linear gradient mode.
MGPLUS_EXPORT MPStatus MGPlusPathStartFigure(HPATH path)
Add a new sub path.
MGPLUS_EXPORT MPStatus MGPlusPenSetDashes(HPEN pen, int dash_phase, const unsigned char *dash_list, int dash_len)
Set the pen dashes.
enum _MPBrushType MPBrushType
Brush type.
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColorsEx(HBRUSH brush, ARGB *colors, int count, float *position)
Set the start color and end color with the linear gradient brush, and every color with position info...
MGPLUS_EXPORT MPStatus MGPlusPathMovetoI(HPATH path, int x, int y)
Move the path to a new point.
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushColors(HBRUSH brush, ARGB *colors, int count)
Set the start color and end color with the linear gradient brush.
MGPLUS_EXPORT MPStatus MGPlusDrawArc(HGRAPHICS graphics, HPEN pen, float x, float y, float width, float height, float startangle, float sweepangle)
Draw a arc on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPenSetJoinStyle(HPEN pen, LINE_JOIN_E line_join)
Set the pen line join style.
enum _MPTextRenderingHint MPTextRenderingHint
Text rendering hint.
MGPLUS_EXPORT MPStatus MGPlusPathRotateAroundPoint(HPATH path, const MPPOINT *pt, float angle)
Transform the special path to rotating around the point.
DWORD HFONT
Data type of font.
Definition: mgplus.h:136
MGPLUS_EXPORT MPStatus MGPlusPathArctoI(HPATH path, int x1, int y1, int x2, int y2, int radius)
Add a arc to a path and two tangent line through subpath last vectors, (x1, y1), (x2, y2).
DWORD HPEN
Data type of pen.
Definition: mgplus.h:129
MGPLUS_EXPORT MPStatus MGPlusPathReset(HPATH path)
Reset the path.
MGPLUS_EXPORT MPStatus MGPlusGetPathRenderingHint(HGRAPHICS graphics, MPPathRenderingHint *value)
Get the path anti-alias value of graphic.
MGPLUS_EXPORT MPStatus MGPlusPenSetColor(HPEN pen, ARGB rgba)
Set the pen color.
DWORD HGRAPHICS
Data type of graphic.
Definition: mgplus.h:108
MGPLUS_EXPORT MPStatus MGPlusGraphicLoadBitmapFromFile(HGRAPHICS graphics, int n_index, char *file)
Load the file to graphic&#39;s inner resource.
MGPLUS_EXPORT MPStatus MGPlusSetPathRenderingHint(HGRAPHICS graphics, MPPathRenderingHint value)
Set the path anti-alias value of graphic.
MGPLUS_EXPORT MPStatus MGPlusPathGetPoints(HPATH path, int *count, MPPOINT **pt)
Get the key points coor of the path.
MGPLUS_EXPORT MPStatus MGPlusDeleteFont(HFONT hfont)
Delete font.
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushMode(HBRUSH brush, MPLinearGradientMode mode)
Set the linear gradient brush mode.
MGPLUS_EXPORT MPStatus MGPlusSetImageAlpha(HGRAPHICS graphics, int alpha)
Set image alpha of graphic.
MGPLUS_EXPORT MPStatus MGPlusSetLinearGradientBrushRect(HBRUSH brush, RECT *rect)
Set the rect of the linear gradient brush.
MGPLUS_EXPORT MPStatus MGPlusDrawEllipse(HGRAPHICS graphics, HPEN pen, float cx, float cy, float rx, float ry)
Draw a ellipse on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathBezierto(HPATH path, float x1, float y1, float x2, float y2, float x3, float y3)
Add a bezier curve to the last vector.
MGPLUS_EXPORT MPStatus MGPlusPathAddArcI(HPATH path, int cx, int cy, int rx, int ry, int startAngle, int sweepAngle)
Add a arc to a path.
MGPLUS_EXPORT MPStatus MGPlusPathTranslate(HPATH path, float dx, float dy)
Scale the special path.
MGPLUS_EXPORT MPStatus MGPlusFillArcI(HGRAPHICS graphics, HBRUSH brush, int x, int y, int width, int height, float startAngle, float sweepAngle)
Fill a arc on the graphic.
MGPLUS_EXPORT MPStatus MGPlusSetClipPath(HGRAPHICS graphics, HPATH path)
Set the path as a clip on the graphic.
MGPLUS_EXPORT MPStatus MGPlusSetSolidBrushColor(HBRUSH brush, ARGB rgba)
Set color with solid brush.
MGPLUS_EXPORT MPStatus MGPlusSetTextureBrushImage(HBRUSH brush, BITMAP *bitmap)
Set image with texture brush.
MGPLUS_EXPORT MPStatus MGPlusDrawBezier(HGRAPHICS graphics, HPEN pen, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Draw a bezier on the graphic.
MGPLUS_EXPORT MPStatus MGPlusGraphicBlend(HGRAPHICS src_gs, HGRAPHICS dst_gs)
Blend between Graphic’s buffer.
MGPLUS_EXPORT MPStatus MGPlusSetCompositingMode(HGRAPHICS graphics, MPCompositingMode composite_mode)
Set the compositing mode of graphic.
MGPLUS_EXPORT MPStatus MGPlusPathDelete(HPATH path)
Delete the HPATH.
MGPLUS_EXPORT MPStatus MGPlusBrushDelete(HBRUSH brush)
Delete a brush.
MGPLUS_EXPORT MPStatus MGPlusPenDelete(HPEN pen)
Delete a pen.
MGPLUS_EXPORT MPStatus MGPlusPathAddEllipse(HPATH path, float cx, float cy, float rx, float ry, BOOL clockwise)
Add a ellipse to a path.
MGPLUS_EXPORT MPStatus MGPlusWorldTransform(HGRAPHICS graphics, MPMatrix *matrix)
Multi the special matrix with matrix of graphic.
MGPLUS_EXPORT MPStatus MGPlusDrawRectangle(HGRAPHICS graphics, HPEN pen, float x, float y, float width, float height)
Draw a rectangle on the graphic.
struct _MPPOINT MPPOINT
MGPLUS_EXPORT MPStatus MGPlusPathAddEllipseI(HPATH path, int cx, int cy, int rx, int ry, BOOL clockwise)
Add a ellipse to a path.
MGPLUS_EXPORT MPStatus MGPlusGraphicUnLoadBitmap(HGRAPHICS graphics, int n_index)
UnLoad the p_bitmap to graphic&#39;s inner resource.
MGPLUS_EXPORT MPStatus MGPlusPathQuadraticto(HPATH path, float x1, float y1, float x2, float y2)
Add a quadratic curve to the last vector.
MGPLUS_EXPORT MPStatus MGPlusPathBeziertoI(HPATH path, int x1, int y1, int x2, int y2, int x3, int y3)
Add a bezier curve to the last vector.
enum _MPGlyphRendering MPGlyphRendering
Glyph rendering mode.
MGPLUS_EXPORT MPStatus MGPlusFillRectangleI(HGRAPHICS graphics, HBRUSH brush, int x, int y, int width, int height)
Draw a rectangle on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathAddRectangle(HPATH path, float x, float y, float width, float height)
Add a rectangle to the path.
MGPLUS_EXPORT MPStatus MGPlusPathAddRoundRectEx(HPATH path, int x, int y, int width, int height, int rx, int ry)
Add a round rect to the path .
MGPLUS_EXPORT MPStatus MGPlusDrawRoundRectIEx(HGRAPHICS graphics, HPEN pen, int x, int y, int width, int height, int rx, int ry)
Draw a roundrect on the graphic.
MGPLUS_EXPORT MPStatus MGPlusGetInterpolationMode(HGRAPHICS graphics, MPInterpolationMode *mode)
Get the interpolation mode of graphic.
MGPLUS_EXPORT MPStatus MGPlusSetInterpolationMode(HGRAPHICS graphics, MPInterpolationMode mode)
Set the interpolation mode of graphic.
MGPLUS_EXPORT int MGPlusSaveHG(HGRAPHICS hg)
Save the graphic to stack.
MGPLUS_EXPORT MPStatus MGPlusGraphicCopy(HGRAPHICS src_gs, HGRAPHICS dst_gs)
Copy the src graphic to dst.
MGPLUS_EXPORT MPStatus MGPlusSetSmoothingMode(HGRAPHICS graphics, MPSmoothingMode value)
Set the smoothing mode of graphic.
enum _MPCompositingMode MPCompositingMode
Compositing mode.
enum _MPStatus MPStatus
Status.
enum _MPFillMode MPFillMode
Path fill mode.
enum _MPPathRenderingHint MPPathRenderingHint
Path rendering hint.
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundRect(HBRUSH brush, RECT *rect)
Set the single color rect with path gradient brush.
MGPLUS_EXPORT HBRUSH MGPlusBrushCreate(MPBrushType type)
Create a brush.
MGPLUS_EXPORT MPStatus MGPlusPenSetWidth(HPEN pen, int width)
Set the pen width.
MGPLUS_EXPORT MPStatus MGPlusGraphicClearEx(HGRAPHICS graphics, RECT *rect, ARGB color)
Use color to clear graphics with the specific rect.
MGPLUS_EXPORT MPStatus MGPlusGetGlyphOutline(HFONT hfont, unsigned uchar, LPGLYPHMETRICS lpgm, LPGLYPHDATA lpdata)
Get the font path or LPGLYPHMETERICS info through uFormat.
MGPLUS_EXPORT MPStatus MGPlusDrawImageWithPoints(HGRAPHICS graphics, int n_index, const MPPOINT *point, int count)
Draw the image with a series of points on the graphic.
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushSurroundColors(HBRUSH brush, ARGB *rgba, int count)
Set the surround color with path gradient brush.
MGPLUS_EXPORT MPStatus MGPlusDrawArcI(HGRAPHICS graphics, HPEN pen, int x, int y, int width, int height, float startAngle, float sweepAngle)
Draw a arc on the graphic.
enum _PATH_VERTEX_COMMANDS PATH_VERTEX_COMMANDS
Path vertex&#39;s command.
MGPLUS_EXPORT MPStatus MGPlusDrawLineI(HGRAPHICS graphics, HPEN pen, int x1, int y1, int x2, int y2)
Draw a line on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathCloseFigure(HPATH path)
Close the current sub path.
MGPLUS_EXPORT MPStatus MGPlusPathMoveto(HPATH path, float x, float y)
Move the path to a new point.
MGPLUS_EXPORT MPStatus MGPlusFillArc(HGRAPHICS graphics, HBRUSH brush, float x, float y, float width, float height, float startangle, float sweepangle)
Fill a arc on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathScale(HPATH path, float sx, float sy)
Scale the special path.
MGPLUS_EXPORT MPStatus MGPlusPathAddBezierI(HPATH path, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
Add a bezier to the path .
DWORD HPATH
Data type of path.
Definition: mgplus.h:115
enum _LINE_JOIN_E LINE_JOIN_E
Join mode.
enum _MPSmoothingMode MPSmoothingMode
Smoothing mode.
enum _MPRenderingControl MPRenderingControl
Rendering control mode.
enum _GLYPH_DATE_TYPE GLYPH_DATE_TYPE
Glyph data type.
MGPLUS_EXPORT int MGPlusLinearGradientBrushGetColorNumber(HBRUSH brush)
get the linear gradient brush color number.
MGPLUS_EXPORT MPStatus MGPlusDrawRoundRectEx(HGRAPHICS graphics, HPEN pen, float x, float y, float width, float height, float rx, float ry)
Draw a roundrect on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathTransform(HPATH path)
Transform the path using its matrix.
MGPLUS_EXPORT MPStatus MGPlusFillEllipse(HGRAPHICS graphics, HBRUSH brush, float cx, float cy, float rx, float ry)
Fill a ellipse on the graphic.
MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreate(int width, int height)
Create graphic.
enum _MPOrientation MPOrientation
Path vertex&#39;s command.
MGPLUS_EXPORT BOOL MGPlusRegisterFashionLFRDR(void)
Registers the Fashion LFRDR.
MGPLUS_EXPORT MPStatus MGPlusGetTextRenderingHint(HGRAPHICS graphics, MPTextRenderingHint *value)
Get the text rendering mode of graphic.
MGPLUS_EXPORT MPStatus MGPlusPathAddCurve(HPATH path, const MPPOINT *points, int count)
Add a curve to a path.
MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushGetColors(HBRUSH brush, ARGB *color, float *position)
get the linear gradient brush color.
MGPLUS_EXPORT MPStatus MGPlusGraphicDelete(HGRAPHICS graphics)
Delete the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathArcto(HPATH path, double x1, double y1, double x2, double y2, double radius)
Add a arc to a path and two tangent line of arc.
MGPLUS_EXPORT MPStatus MGPlusDrawRectangleI(HGRAPHICS graphics, HPEN pen, int x, int y, int width, int height)
Draw a rectangle on the graphic.
MGPLUS_EXPORT MPStatus MGPlusFillRectangle(HGRAPHICS graphics, HBRUSH brush, float x, float y, float width, float height)
Draw a rectangle on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathAddArc(HPATH path, float cx, float cy, float rx, float ry, float startAngle, float sweepAngle)
Add a arc to a path.
MGPLUS_EXPORT MPStatus MGPlusLinearGradientBrushAddColor(HBRUSH brush, ARGB color, float position)
Add the linear gradient brush color.
MGPLUS_EXPORT MPStatus MGPlusPathLinetoI(HPATH path, int x, int y)
Line the path to a new point.
MGPLUS_EXPORT MPStatus MGPlusGetSmoothingMode(HGRAPHICS graphics, MPSmoothingMode *value)
Set the smoothing mode of graphic.
DWORD ARGB
Data type of color.
Definition: mgplus.h:143
MGPLUS_EXPORT MPStatus MGPlusPathGetPointCount(HPATH path, int *count)
Get the key points count of the path.
MGPLUS_EXPORT MPStatus MGPlusFillBezier(HGRAPHICS graphics, HBRUSH brush, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
Fill a bezier on the graphic.
struct _MPMatrix MPMatrix
MGPLUS_EXPORT MPStatus MGPlusGetLinearGradientBrushMode(HBRUSH brush, MPLinearGradientMode *mode)
Get the linear gradient brush mode.
MGPLUS_EXPORT HDC MGPlusGetGraphicDC(HGRAPHICS graphic)
Get graphic’s buffer hdc.
MGPLUS_EXPORT BOOL MGPlusRestoreHG(HGRAPHICS hg, int saved_hg)
Restore the graphic.
MGPLUS_EXPORT HPATH MGPlusPathCreate(MPFillMode brushMode)
Create a path.
MPStatus MGPlusGetSolidBrushColor(HBRUSH brush, ARGB *rgba)
Set color with solid brush.
MGPLUS_EXPORT MPStatus MGPlusFillPath(HGRAPHICS graphics, HBRUSH brush, HPATH path)
Fill the path with a brush on the graphic.
MGPLUS_EXPORT MPStatus MGPlusTranslateWorldTransform(HGRAPHICS graphics, float dx, float dy)
Translate the world transform of graphic.
MGPLUS_EXPORT MPStatus MGPlusGraphicSave(HGRAPHICS graphics, HDC hdc, int sx, int sy, int sw, int sh, int dx, int dy)
Create Graphic’s buffer through hdc.
MGPLUS_EXPORT MPStatus MGPlusSetTextRenderingHint(HGRAPHICS graphics, MPTextRenderingHint value)
Set the text rendering mode of graphic.
MGPLUS_EXPORT MPStatus MGPlusPathSetTransform(HPATH path, MPMatrix *matrix)
Set the transform matrix to the special path.
MGPLUS_EXPORT MPStatus MGPlusPathQuadratictoI(HPATH path, int x1, int y1, int x2, int y2)
Add a quadratic curve to the last vector.
MGPLUS_EXPORT MPStatus MGPlusDrawBezierI(HGRAPHICS graphics, HPEN pen, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
Draw a bezier on the graphic.
MGPLUS_EXPORT MPStatus MGPlusDrawGlyph(HGRAPHICS graphics, HFONT hfont, int x, int y, LPGLYPHDATA lpdata, ARGB color)
Draw glyph path.
MGPLUS_EXPORT MPStatus MGPlusDrawImageWithPath(HGRAPHICS graphics, int n_index, HPATH path)
Draw the image with a path on the graphic.
MGPLUS_EXPORT MPStatus MGPlusPathGetVertex(HPATH path, int idx, double *x, double *y, int *cmd)
Get the special idx vertex of the path.
MGPLUS_EXPORT HFONT MGPlusCreateFont(const char *font_name, unsigned face_index, MPGlyphRendering ren_type, unsigned int width, unsigned int height, BOOL flip_y)
Create ttf font.
MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreateWithoutCanvas(HDC hdc)
Create graphic from hdc and use hdc&#39;s surface as canvas.
MGPLUS_EXPORT MPStatus MGPlusPathSetAllOrientation(HPATH path, MPOrientation orientation)
Set all path orientation.
MGPLUS_EXPORT MPStatus MGPlusFillBezierI(HGRAPHICS graphics, HBRUSH brush, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
Fill a bezier on the graphic.
MGPLUS_EXPORT MPStatus MGPlusGraphicCopyFromDC(HGRAPHICS graphic, HDC hdc, int sx, int sy, int sw, int sh, int dx, int dy)
Copy the hdc content to graphic.
DWORD HBRUSH
Data type of brush.
Definition: mgplus.h:122
MGPLUS_EXPORT MPStatus MGPlusGetImageAlpha(HGRAPHICS graphics, int *alpha)
Get image alpha of graphic.
MGPLUS_EXPORT MPStatus MGPlusPenSetCapStyle(HPEN pen, LINE_CAP_E line_cap)
Set the pen line cap style.
MGPLUS_EXPORT MPStatus MGPlusPathRotate(HPATH path, float angle)
Scale the special path.
MGPLUS_EXPORT MPStatus MGPlusPathGetTransform(HPATH path, MPMatrix *matrix)
Get the special path&#39;s transform matrix .
MGPLUS_EXPORT MPStatus MGPlusRotateWorldTransform(HGRAPHICS graphics, float angle)
Rotate the world transform of graphic.
MGPLUS_EXPORT MPStatus MGPlusPathAddLineI(HPATH path, int x1, int y1, int x2, int y2)
Add a line to a path.
MGPLUS_EXPORT MPStatus MGPlusScaleWorldTransform(HGRAPHICS graphics, float sx, float sy)
Scale the world transform of graphic.
MGPLUS_EXPORT MPStatus MGPlusGetWorldTransform(HGRAPHICS graphics, MPMatrix *matrix)
Get the world transform of graphic.
MGPLUS_EXPORT MPStatus MGPlusPathAddPath(HPATH path, HPATH add_path)
copy a path to the other path.
MGPLUS_EXPORT MPStatus MGPlusFillRoundRectEx(HGRAPHICS graphics, HBRUSH brush, float x, float y, float width, float height, float rx, float ry)
Draw a round rect on the graphic.
MGPLUS_EXPORT HGRAPHICS MGPlusGraphicCreateFromDC(HDC hdc)
Create Graphic’s buffer through hdc.
MGPLUS_EXPORT MPStatus MGPlusDrawImage(HGRAPHICS graphics, int n_index, int x, int y, int w, int h)
Draw the image with on the graphic.
MGPLUS_EXPORT MPStatus MGPlusSetPathGradientBrushCenterColor(HBRUSH brush, ARGB rgba)
Set the center point color with path gradient brush.
MGPLUS_EXPORT MPStatus MGPlusPathAddLine(HPATH path, float x1, float y1, float x2, float y2)
Add a line to a path.
MGPLUS_EXPORT MPStatus MGPlusGraphicLoadBitmap(HGRAPHICS graphics, int n_index, PBITMAP p_bitmap)
Load the p_bitmap to graphic&#39;s inner resource.
enum _MPInterpolationMode MPInterpolationMode
Interpolation mode.
MGPLUS_EXPORT MPStatus MGPlusPathResetTransform(HPATH path)
Reset the transform matrix of the special path.