GdiPlusPath.h
上传用户:jinlangri
上传日期:2022-07-17
资源大小:10774k
文件大小:49k
源码类别:

GDI/图象编程

开发平台:

Visual C++

  1. /**************************************************************************
  2. *
  3. * Copyright (c) 1998-2000, Microsoft Corp.  All Rights Reserved.
  4. *
  5. * Module Name:
  6. *
  7. *   GdiplusPath.h
  8. *
  9. * Abstract:
  10. *
  11. *   Path related declarations
  12. *
  13. **************************************************************************/
  14. #ifndef _GDIPLUSPATH_H
  15. #define _GDIPLUSPATH_H
  16. class GraphicsPath : public GdiplusBase
  17. {
  18. public:
  19.     friend class Graphics;
  20.     friend class Region;
  21.     friend class PathGradientBrush;
  22.     friend class GraphicsPathIterator;
  23.     friend class CustomLineCap;
  24.     // Path constructors
  25.     GraphicsPath(IN FillMode fillMode = FillModeAlternate)
  26.     {
  27.         nativePath = NULL;
  28.         lastResult = DllExports::GdipCreatePath(fillMode, &nativePath);
  29.     }
  30.     GraphicsPath(IN const PointF* points,
  31.                  IN const BYTE* types,
  32.                  IN INT count,
  33.                  IN FillMode fillMode = FillModeAlternate)
  34.     {
  35.         nativePath = NULL;
  36.         lastResult = DllExports::GdipCreatePath2(points,
  37.                                                  types,
  38.                                                  count,
  39.                                                  fillMode,
  40.                                                  &nativePath);
  41.     }
  42.     GraphicsPath(IN const Point* points,
  43.                  IN const BYTE* types,
  44.                  IN INT count,
  45.                  IN FillMode fillMode = FillModeAlternate)
  46.     {
  47.         nativePath = NULL;
  48.         lastResult = DllExports::GdipCreatePath2I(points,
  49.                                                   types,
  50.                                                   count,
  51.                                                   fillMode,
  52.                                                   &nativePath);
  53.     }
  54.     ~GraphicsPath()
  55.     {
  56.         DllExports::GdipDeletePath(nativePath);
  57.     }
  58.     /**
  59.      * Make a copy of the current path object
  60.      */
  61.     GraphicsPath* Clone() const
  62.     {
  63.         GpPath *clonepath = NULL;
  64.         SetStatus(DllExports::GdipClonePath(nativePath, &clonepath));
  65.         return new GraphicsPath(clonepath);
  66.     }
  67.     /**
  68.      * Reset the path object to empty (and fill mode to FillModeAlternate)
  69.      */
  70.     Status Reset()
  71.     {
  72.         return SetStatus(DllExports::GdipResetPath(nativePath));
  73.     }
  74.     /**
  75.      * Get path fill mode information
  76.      */
  77.     FillMode GetFillMode() const
  78.     {
  79.         FillMode fillmode = FillModeAlternate;
  80.         SetStatus(DllExports::GdipGetPathFillMode(nativePath, &fillmode));
  81.         return fillmode;
  82.     }
  83.     /**
  84.      * Set path fill mode information
  85.      */
  86.     Status SetFillMode(IN FillMode fillmode)
  87.     {
  88.         return SetStatus(DllExports::GdipSetPathFillMode(nativePath, fillmode));
  89.     }
  90.     /**
  91.      * Set/get path data
  92.      */
  93.     Status GetPathData(OUT PathData* pathData) const
  94.     {
  95.         if (pathData == NULL) 
  96.         {
  97.             return SetStatus(InvalidParameter);
  98.         }
  99.         
  100.         INT count = GetPointCount();
  101.         
  102.         if ((count <= 0) || (pathData->Count>0 && pathData->Count<count))
  103.         {
  104.             pathData->Count = 0;
  105.             if (pathData->Points)
  106.             {
  107.                 delete pathData->Points;
  108.                 pathData->Points = NULL;
  109.             }
  110.             if (pathData->Types) 
  111.             {
  112.                 delete pathData->Types;
  113.                 pathData->Types = NULL;
  114.             }
  115.             if (count <= 0)
  116.             {
  117.                 return lastResult;
  118.             }
  119.         }
  120.         if (pathData->Count == 0) 
  121.         {
  122.             pathData->Points = new PointF[count];
  123.             if (pathData->Points == NULL) 
  124.             {
  125.                 return SetStatus(OutOfMemory);
  126.             
  127.             }
  128.             pathData->Types = new byte[count];
  129.             if (pathData->Types == NULL) 
  130.             {
  131.                 delete pathData->Points;
  132.                 pathData->Points = NULL;
  133.                 return SetStatus(OutOfMemory);
  134.             }
  135.             pathData->Count = count;
  136.         }
  137.         return SetStatus(DllExports::GdipGetPathData(nativePath, pathData));
  138.     }
  139.     /**
  140.      * Start/end a subpath
  141.      */
  142.     Status StartFigure()
  143.     {
  144.         return SetStatus(DllExports::GdipStartPathFigure(nativePath));
  145.     }
  146.     Status CloseFigure()
  147.     {
  148.         return SetStatus(DllExports::GdipClosePathFigure(nativePath));
  149.     }
  150.     Status CloseAllFigures()
  151.     {
  152.         return SetStatus(DllExports::GdipClosePathFigures(nativePath));
  153.     }
  154.     Status SetMarker()
  155.     {
  156.         return SetStatus(DllExports::GdipSetPathMarker(nativePath));
  157.     }
  158.     Status ClearMarkers()
  159.     {
  160.         return SetStatus(DllExports::GdipClearPathMarkers(nativePath));
  161.     }
  162.     Status Reverse()
  163.     {
  164.         return SetStatus(DllExports::GdipReversePath(nativePath));
  165.     }
  166.     Status GetLastPoint(OUT PointF* lastPoint) const
  167.     {
  168.         return SetStatus(DllExports::GdipGetPathLastPoint(nativePath, lastPoint));
  169.     }
  170.     /**
  171.      * Add lines to the path object
  172.      */
  173.     // float version
  174.     Status AddLine(IN const PointF& pt1, 
  175.                    IN const PointF& pt2)
  176.     {
  177.         return AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y);
  178.     }
  179.     Status AddLine(IN REAL x1,
  180.                    IN REAL y1, 
  181.                    IN REAL x2, 
  182.                    IN REAL y2)
  183.     {
  184.         return SetStatus(DllExports::GdipAddPathLine(nativePath, x1, y1, x2, y2));
  185.     }
  186.     Status AddLines(IN const PointF* points, 
  187.                     IN INT count)
  188.     {
  189.         return SetStatus(DllExports::GdipAddPathLine2(nativePath, points, count));
  190.     }
  191.     // integer version
  192.     Status AddLine(IN const Point& pt1, 
  193.                    IN const Point& pt2)
  194.     {
  195.         return AddLine(pt1.X,
  196.                        pt1.Y,
  197.                        pt2.X,
  198.                        pt2.Y);
  199.     }
  200.     Status AddLine(IN INT x1, 
  201.                    IN INT y1, 
  202.                    IN INT x2, 
  203.                    IN INT y2)
  204.     {
  205.         return SetStatus(DllExports::GdipAddPathLineI(nativePath,
  206.                                                      x1,
  207.                                                      y1,
  208.                                                      x2,
  209.                                                      y2));
  210.     }
  211.     Status AddLines(IN const Point* points, 
  212.                     IN INT count)
  213.     {
  214.         return SetStatus(DllExports::GdipAddPathLine2I(nativePath,
  215.                                                        points,
  216.                                                        count));
  217.     }
  218.     /**
  219.      * Add an arc to the path object
  220.      */
  221.     // float version
  222.     Status AddArc(IN const RectF& rect, 
  223.                   IN REAL startAngle, 
  224.                   IN REAL sweepAngle)
  225.     {
  226.         return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
  227.                       startAngle, sweepAngle);
  228.     }
  229.     Status AddArc(IN REAL x, 
  230.                   IN REAL y, 
  231.                   IN REAL width, 
  232.                   IN REAL height,
  233.                   IN REAL startAngle, 
  234.                   IN REAL sweepAngle)
  235.     {
  236.         return SetStatus(DllExports::GdipAddPathArc(nativePath, x, y, width, height,
  237.                                       startAngle, sweepAngle));
  238.     }
  239.     // integer version
  240.     Status AddArc(IN const Rect& rect, 
  241.                   IN REAL startAngle, 
  242.                   IN REAL sweepAngle)
  243.     {
  244.         return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
  245.                       startAngle, sweepAngle);
  246.     }
  247.     Status AddArc(IN INT x, 
  248.                   IN INT y, 
  249.                   IN INT width, 
  250.                   IN INT height,
  251.                   IN REAL startAngle, 
  252.                   IN REAL sweepAngle)
  253.     {
  254.         return SetStatus(DllExports::GdipAddPathArcI(nativePath,
  255.                                                     x,
  256.                                                     y,
  257.                                                     width,
  258.                                                     height,
  259.                                                     startAngle,
  260.                                                     sweepAngle));
  261.     }
  262.     /**
  263.      * Add Bezier curves to the path object
  264.      */
  265.     // float version
  266.     Status AddBezier(IN const PointF& pt1, 
  267.                      IN const PointF& pt2,
  268.                      IN const PointF& pt3, 
  269.                      IN const PointF& pt4)
  270.     {
  271.         return AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
  272.                          pt4.Y);
  273.     }
  274.     Status AddBezier(IN REAL x1, 
  275.                      IN REAL y1, 
  276.                      IN REAL x2, 
  277.                      IN REAL y2,
  278.                      IN REAL x3, 
  279.                      IN REAL y3, 
  280.                      IN REAL x4, 
  281.                      IN REAL y4)
  282.     {
  283.         return SetStatus(DllExports::GdipAddPathBezier(nativePath, x1, y1, x2, y2,
  284.                                      x3, y3, x4, y4));
  285.     }
  286.     Status AddBeziers(IN const PointF* points, 
  287.                       IN INT count)
  288.     {
  289.         return SetStatus(DllExports::GdipAddPathBeziers(nativePath, points, count));
  290.     }
  291.     // integer version
  292.     Status AddBezier(IN const Point& pt1, 
  293.                      IN const Point& pt2,
  294.                      IN const Point& pt3, 
  295.                      IN const Point& pt4)
  296.     {
  297.        return AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
  298.                         pt4.Y);
  299.     }
  300.     Status AddBezier(IN INT x1, 
  301.                      IN INT y1, 
  302.                      IN INT x2, 
  303.                      IN INT y2,
  304.                      IN INT x3,
  305.                      IN INT y3, 
  306.                      IN INT x4, 
  307.                      IN INT y4)
  308.     {
  309.        return SetStatus(DllExports::GdipAddPathBezierI(nativePath,
  310.                                                       x1,
  311.                                                       y1,
  312.                                                       x2,
  313.                                                       y2,
  314.                                                       x3,
  315.                                                       y3,
  316.                                                       x4,
  317.                                                       y4));
  318.     }
  319.     Status AddBeziers(IN const Point* points,
  320.                       IN INT count)
  321.     {
  322.        return SetStatus(DllExports::GdipAddPathBeziersI(nativePath,
  323.                                                         points,
  324.                                                         count));
  325.     }
  326.     // float version
  327.     Status AddCurve(IN const PointF* points, 
  328.                     IN INT count)
  329.     {
  330.         return SetStatus(DllExports::GdipAddPathCurve(nativePath,
  331.                                                       points,
  332.                                                       count));
  333.     }
  334.     Status AddCurve(IN const PointF* points, 
  335.                     IN INT count,
  336.                     IN REAL tension)
  337.     {
  338.         return SetStatus(DllExports::GdipAddPathCurve2(nativePath,
  339.                                                        points,
  340.                                                        count,
  341.                                                        tension));
  342.     }
  343.     Status AddCurve(IN const PointF* points, 
  344.                     IN INT count, 
  345.                     IN INT offset,
  346.                     IN INT numberOfSegments, 
  347.                     IN REAL tension)
  348.     {
  349.         return SetStatus(DllExports::GdipAddPathCurve3(nativePath,
  350.                                                        points,
  351.                                                        count,
  352.                                                        offset,
  353.                                                        numberOfSegments,
  354.                                                        tension));
  355.     }
  356.     // integer version
  357.     Status AddCurve(IN const Point* points, 
  358.                     IN INT count)
  359.     {
  360.        return SetStatus(DllExports::GdipAddPathCurveI(nativePath,
  361.                                                      points,
  362.                                                      count));
  363.     }
  364.     Status AddCurve(IN const Point* points, 
  365.                     IN INT count, 
  366.                     IN REAL tension)
  367.     {
  368.        return SetStatus(DllExports::GdipAddPathCurve2I(nativePath,
  369.                                                       points,
  370.                                                       count,
  371.                                                       tension));
  372.     }
  373.     Status AddCurve(IN const Point* points, 
  374.                     IN INT count, 
  375.                     IN INT offset,
  376.                     IN INT numberOfSegments, 
  377.                     IN REAL tension)
  378.     {
  379.        return SetStatus(DllExports::GdipAddPathCurve3I(nativePath,
  380.                                                       points,
  381.                                                       count,
  382.                                                       offset,
  383.                                                       numberOfSegments,
  384.                                                       tension));
  385.     }
  386.     // float version
  387.     Status AddClosedCurve(IN const PointF* points, 
  388.                           IN INT count)
  389.     {
  390.         return SetStatus(DllExports::GdipAddPathClosedCurve(nativePath,
  391.                                                             points,
  392.                                                             count));
  393.     }
  394.     Status AddClosedCurve(IN const PointF* points, 
  395.                           IN INT count, 
  396.                           IN REAL tension)
  397.     {
  398.         return SetStatus(DllExports::GdipAddPathClosedCurve2(nativePath,
  399.                                                              points,
  400.                                                              count,
  401.                                                              tension));
  402.     }
  403.     // integer version
  404.     Status AddClosedCurve(IN const Point* points, 
  405.                           IN INT count)
  406.     {
  407.        return SetStatus(DllExports::GdipAddPathClosedCurveI(nativePath,
  408.                                                             points,
  409.                                                             count));
  410.     }
  411.     Status AddClosedCurve(IN const Point* points, 
  412.                           IN INT count,
  413.                           IN REAL tension)
  414.     {
  415.        return SetStatus(DllExports::GdipAddPathClosedCurve2I(nativePath,
  416.                                                              points,
  417.                                                              count,
  418.                                                              tension));
  419.     }
  420.     /**
  421.      * Add closed shapes to the path object
  422.      */
  423.     // float version
  424.     Status AddRectangle(IN const RectF& rect)
  425.     {
  426.         return SetStatus(DllExports::GdipAddPathRectangle(nativePath,
  427.                                                           rect.X,
  428.                                                           rect.Y,
  429.                                                           rect.Width,
  430.                                                           rect.Height));
  431.     }
  432.     Status AddRectangles(IN const RectF* rects, 
  433.                          IN INT count)
  434.     {
  435.         return SetStatus(DllExports::GdipAddPathRectangles(nativePath,
  436.                                                            rects,
  437.                                                            count));
  438.     }
  439.     // integer version
  440.     Status AddRectangle(IN const Rect& rect)
  441.     {
  442.         return SetStatus(DllExports::GdipAddPathRectangleI(nativePath,
  443.                                                           rect.X,
  444.                                                           rect.Y,
  445.                                                           rect.Width,
  446.                                                           rect.Height));
  447.     }
  448.     Status AddRectangles(IN const Rect* rects, INT count)
  449.     {
  450.         return SetStatus(DllExports::GdipAddPathRectanglesI(nativePath,
  451.                                                            rects,
  452.                                                            count));
  453.     }
  454.     // float version
  455.     Status AddEllipse(IN const RectF& rect)
  456.     {
  457.         return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
  458.     }
  459.     Status AddEllipse(IN REAL x, 
  460.                       IN REAL y, 
  461.                       IN REAL width, 
  462.                       IN REAL height)
  463.     {
  464.         return SetStatus(DllExports::GdipAddPathEllipse(nativePath,
  465.                                                         x,
  466.                                                         y,
  467.                                                         width,
  468.                                                         height));
  469.     }
  470.     // integer version
  471.     Status AddEllipse(IN const Rect& rect)
  472.     {
  473.         return AddEllipse(rect.X, rect.Y, rect.Width, rect.Height);
  474.     }
  475.     Status AddEllipse(IN INT x, 
  476.                       IN INT y, 
  477.                       IN INT width, 
  478.                       IN INT height)
  479.     {
  480.         return SetStatus(DllExports::GdipAddPathEllipseI(nativePath,
  481.                                                         x,
  482.                                                         y,
  483.                                                         width,
  484.                                                         height));
  485.     }
  486.     // float version
  487.     Status AddPie(IN const RectF& rect, 
  488.                   IN REAL startAngle, 
  489.                   IN REAL sweepAngle)
  490.     {
  491.         return AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle,
  492.                       sweepAngle);
  493.     }
  494.     Status AddPie(IN REAL x, 
  495.                   IN REAL y, 
  496.                   IN REAL width, 
  497.                   IN REAL height, 
  498.                   IN REAL startAngle,
  499.                   IN REAL sweepAngle)
  500.     {
  501.         return SetStatus(DllExports::GdipAddPathPie(nativePath, x, y, width, height,
  502.                                       startAngle, sweepAngle));
  503.     }
  504.     // integer version
  505.     Status AddPie(IN const Rect& rect, 
  506.                   IN REAL startAngle, 
  507.                   IN REAL sweepAngle)
  508.     {
  509.         return AddPie(rect.X,
  510.                       rect.Y,
  511.                       rect.Width,
  512.                       rect.Height,
  513.                       startAngle,
  514.                       sweepAngle);
  515.     }
  516.     Status AddPie(IN INT x, 
  517.                   IN INT y, 
  518.                   IN INT width, 
  519.                   IN INT height, 
  520.                   IN REAL startAngle,
  521.                   IN REAL sweepAngle)
  522.     {
  523.         return SetStatus(DllExports::GdipAddPathPieI(nativePath,
  524.                                                     x,
  525.                                                     y,
  526.                                                     width,
  527.                                                     height,
  528.                                                     startAngle,
  529.                                                     sweepAngle));
  530.     }
  531.     // float version
  532.     Status AddPolygon(IN const PointF* points, 
  533.                       IN INT count)
  534.     {
  535.         return SetStatus(DllExports::GdipAddPathPolygon(nativePath, points, count));
  536.     }
  537.     // integer version
  538.     Status AddPolygon(IN const Point* points, 
  539.                       IN INT count)
  540.     {
  541.        return SetStatus(DllExports::GdipAddPathPolygonI(nativePath, points, count));
  542.     }
  543.     Status AddPath(IN const GraphicsPath* addingPath, 
  544.                    IN BOOL connect)
  545.     {
  546.         GpPath* nativePath2 = NULL;
  547.         if(addingPath)
  548.             nativePath2 = addingPath->nativePath;
  549.         return SetStatus(DllExports::GdipAddPathPath(nativePath, nativePath2, connect));
  550.     }
  551.     // AddString point version
  552.     Status AddString(
  553.         IN const WCHAR         *string,
  554.         IN INT                  length,
  555.         IN const FontFamily    *family,
  556.         IN INT                  style,
  557.         IN REAL                 emSize,  // In world units
  558.         IN const PointF        &origin,
  559.         IN const StringFormat  *format
  560.     )
  561.     {
  562.         RectF rect(origin.X, origin.Y, 0.0f, 0.0f);
  563.         return SetStatus(DllExports::GdipAddPathString(
  564.             nativePath,
  565.             string,
  566.             length,
  567.             family ? family->nativeFamily : NULL,
  568.             style,
  569.             emSize,
  570.             &rect,
  571.             format ? format->nativeFormat : NULL
  572.         ));
  573.     }
  574.     // AddString rectangle version
  575.     Status AddString(
  576.         IN const WCHAR         *string,
  577.         IN INT                  length,
  578.         IN const FontFamily    *family,
  579.         IN INT                  style,
  580.         IN REAL                 emSize,  // In world units
  581.         IN const RectF         &layoutRect,
  582.         IN const StringFormat  *format
  583.     )
  584.     {
  585.         return SetStatus(DllExports::GdipAddPathString(
  586.             nativePath,
  587.             string,
  588.             length,
  589.             family ? family->nativeFamily : NULL,
  590.             style,
  591.             emSize,
  592.             &layoutRect,
  593.             format ? format->nativeFormat : NULL
  594.         ));
  595.     }
  596.     Status AddString(
  597.         IN const WCHAR         *string,
  598.         IN INT                  length,
  599.         IN const FontFamily    *family,
  600.         IN INT                  style,
  601.         IN REAL                 emSize,  // In world units
  602.         IN const Point         &origin,
  603.         IN const StringFormat  *format
  604.     )
  605.     {
  606.         Rect rect(origin.X, origin.Y, 0, 0);
  607.         return SetStatus(DllExports::GdipAddPathStringI(
  608.             nativePath,
  609.             string,
  610.             length,
  611.             family ? family->nativeFamily : NULL,
  612.             style,
  613.             emSize,
  614.             &rect,
  615.             format ? format->nativeFormat : NULL
  616.         ));
  617.     }
  618.     // AddString rectangle version
  619.     Status AddString(
  620.         IN const WCHAR         *string,
  621.         IN INT                  length,
  622.         IN const FontFamily    *family,
  623.         IN INT                  style,
  624.         IN REAL                 emSize,  // In world units
  625.         IN const Rect          &layoutRect,
  626.         IN const StringFormat  *format
  627.     )
  628.     {
  629.         return SetStatus(DllExports::GdipAddPathStringI(
  630.             nativePath,
  631.             string,
  632.             length,
  633.             family ? family->nativeFamily : NULL,
  634.             style,
  635.             emSize,
  636.             &layoutRect,
  637.             format ? format->nativeFormat : NULL
  638.         ));
  639.     }
  640.     
  641.     /**
  642.      * Transforms the path object
  643.      */
  644.     Status Transform(IN const Matrix* matrix)
  645.     {
  646.         if(matrix)
  647.             return SetStatus(DllExports::GdipTransformPath(nativePath, matrix->nativeMatrix));
  648.         else
  649.             return Ok;  // No need to transform.
  650.     }
  651.     /**
  652.      * Get the bounds of the path object with the given transform.
  653.      * This is not always the tightest bounds.
  654.      *
  655.      * Defined in GdiplusGraphics.h.
  656.      */
  657.     Status GetBounds(OUT RectF* bounds, 
  658.                      IN const Matrix* matrix = NULL, 
  659.                      IN const Pen* pen = NULL) const;
  660.     // integer version (defined in GdiplusGraphics.h)
  661.     Status GetBounds(OUT Rect* bounds,
  662.                      IN const Matrix* matrix = NULL, 
  663.                      IN const Pen* pen = NULL) const;
  664.     /**
  665.      * Flatten the path object
  666.      * Once this is called, the resultant path is made of line segments and
  667.      * the original path information is lost.
  668.      * When matrix = NULL, the identity matrix is assumed.
  669.      */
  670.     Status Flatten(IN const Matrix* matrix = NULL, 
  671.                    IN REAL flatness = FlatnessDefault)
  672.     {
  673.         GpMatrix* nativeMatrix = NULL;
  674.         if(matrix)
  675.         {
  676.             nativeMatrix = matrix->nativeMatrix;
  677.         }
  678.         return SetStatus(DllExports::GdipFlattenPath(
  679.             nativePath, 
  680.             nativeMatrix, 
  681.             flatness
  682.         ));
  683.     }
  684. #ifdef DCR_USE_NEW_202903
  685.     
  686.     Status Widen(
  687.         IN const Pen* pen, 
  688.         IN const Matrix* matrix = NULL,
  689.         IN REAL flatness = FlatnessDefault
  690.     )
  691.     {
  692.         GpMatrix* nativeMatrix = NULL;
  693.         if(matrix)
  694.             nativeMatrix = matrix->nativeMatrix;
  695.         return SetStatus(DllExports::GdipWidenPath(
  696.             nativePath, 
  697.             pen->nativePen,
  698.             nativeMatrix, 
  699.             flatness
  700.         ));
  701.     }
  702. #else
  703.     /**
  704.      * Widen the path object
  705.      * When removeSelfIntersects is TRUE, this returns the widened path
  706.      * without self intersections.
  707.      * When it is FALSE, it returns the widened path with selfintersections.
  708.      * The latter is faster and is usually safficient for filling.
  709.      */
  710.     Status Widen(IN const Pen* pen, 
  711.                  IN const Matrix* matrix = NULL,
  712.                  IN BOOL removeSelfIntersects = TRUE)
  713.     {
  714.         GpMatrix* nativeMatrix = NULL;
  715.         if(matrix)
  716.             nativeMatrix = matrix->nativeMatrix;
  717.         return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
  718.             0, 0, nativeMatrix, removeSelfIntersects));
  719.     }
  720.     /**
  721.      * Widen the path object
  722.      * This is equivalent to Widen() method except that
  723.      * The widths of the widened path are larger than the given
  724.      * minimum resolutions in x and y coordinates after the transform.
  725.      * This is usefull when widening a path with the limited device resolutions.
  726.      */
  727.     Status Widen(IN const Pen* pen, 
  728.                  IN REAL minXres, 
  729.                  IN REAL minYres, 
  730.                  IN const Matrix* matrix = NULL,
  731.                  IN BOOL removeSelfIntersects = TRUE)
  732.     {
  733.         GpMatrix* nativeMatrix = NULL;
  734.         if(matrix)
  735.             nativeMatrix = matrix->nativeMatrix;
  736.         return SetStatus(DllExports::GdipWidenPathWithMinimumResolutions(nativePath, pen->nativePen,
  737.             minXres, minYres, nativeMatrix, removeSelfIntersects));
  738.     }
  739. #endif // DCR_USE_NEW_202903
  740.     Status Outline(
  741.         IN const Matrix *matrix = NULL,
  742.         IN REAL flatness = FlatnessDefault
  743.     )
  744.     {
  745.         GpMatrix* nativeMatrix = NULL;
  746.         if(matrix)
  747.         {
  748.             nativeMatrix = matrix->nativeMatrix;
  749.         }
  750.         return SetStatus(DllExports::GdipWindingModeOutline(
  751.             nativePath, nativeMatrix, flatness
  752.         ));
  753.     }
  754.     
  755.     /**
  756.      * Warp the path object
  757.      * Once this is called, the resultant path is made of line segments and
  758.      * the original path information is lost.
  759.      * When matrix = NULL, the identity matrix is assumed.
  760.      */
  761.     Status Warp(IN const PointF* destPoints, 
  762.                 IN INT count,
  763.                 IN const RectF& srcRect, 
  764.                 IN const Matrix* matrix = NULL,
  765.                 IN WarpMode warpMode = WarpModePerspective,
  766.                 IN REAL flatness = FlatnessDefault)
  767.     {
  768.         GpMatrix* nativeMatrix = NULL;
  769.         if(matrix)
  770.             nativeMatrix = matrix->nativeMatrix;
  771.         return SetStatus(DllExports::GdipWarpPath(
  772.                                         nativePath,
  773.                                         nativeMatrix,
  774.                                         destPoints,
  775.                                         count,
  776.                                         srcRect.X,
  777.                                         srcRect.Y,
  778.                                         srcRect.Width,
  779.                                         srcRect.Height,
  780.                                         warpMode,
  781.                                         flatness));
  782.     }
  783.     /**
  784.      * Return the number of points in the current path
  785.      */
  786.     INT GetPointCount() const
  787.     {
  788.         INT count = 0;
  789.         SetStatus(DllExports::GdipGetPointCount(nativePath, &count));
  790.         return count;
  791.     }
  792.     /**
  793.      * Return the path point type information
  794.      */
  795.     Status GetPathTypes(OUT BYTE* types, 
  796.                         IN INT count) const
  797.     {
  798.         return SetStatus(DllExports::GdipGetPathTypes(nativePath, types, count));
  799.     }
  800.     /**
  801.      * Return the path point coordinate information
  802.      * @notes Should there be PathData that contains types[] and points[]
  803.      *        for get & set purposes.
  804.      */
  805.     Status GetPathPoints(OUT PointF* points, 
  806.                          IN INT count) const
  807.     {
  808.         return SetStatus(DllExports::GdipGetPathPoints(nativePath, points, count));
  809.     }
  810.     // integer version
  811.     Status GetPathPoints(OUT Point* points, 
  812.                          IN INT count) const
  813.     {
  814.         return SetStatus(DllExports::GdipGetPathPointsI(nativePath, points, count));
  815.     }
  816.     Status GetLastStatus() const
  817.     {
  818.         Status lastStatus = lastResult;
  819.         lastResult = Ok;
  820.         return lastStatus;
  821.     }
  822.     /**
  823.      * Hit testing operations
  824.      *
  825.      * inline implementation is in gdiplusgraphics.h.
  826.      */
  827.     BOOL IsVisible(IN const PointF& point, 
  828.                    IN const Graphics* g = NULL) const
  829.     {
  830.         return IsVisible(point.X, point.Y, g);
  831.     }
  832.     
  833.     BOOL IsVisible(IN REAL x, 
  834.                    IN REAL y, 
  835.                    IN const Graphics* g = NULL) const;
  836.     BOOL IsVisible(IN const Point& point,
  837.                    IN const Graphics* g = NULL) const
  838.     {
  839.         return IsVisible(point.X, point.Y, g);
  840.     }
  841.     BOOL IsVisible(IN INT x, 
  842.                    IN INT y, 
  843.                    IN const Graphics* g = NULL) const;
  844.     
  845.     BOOL IsOutlineVisible(IN const PointF& point,
  846.                           IN const Pen* pen, 
  847.                           IN const Graphics* g = NULL) const
  848.     {
  849.         return IsOutlineVisible(point.X, point.Y, pen, g);
  850.     }
  851.     BOOL IsOutlineVisible(IN REAL x, 
  852.                           IN REAL y, 
  853.                           IN const Pen* pen, 
  854.                           IN const Graphics* g = NULL) const;
  855.     BOOL IsOutlineVisible(IN const Point& point,
  856.                           IN const Pen* pen, 
  857.                           IN const Graphics* g = NULL) const
  858.     {
  859.         return IsOutlineVisible(point.X, point.Y, pen, g);
  860.     }
  861.     
  862.     BOOL IsOutlineVisible(IN INT x, 
  863.                           IN INT y, 
  864.                           IN const Pen* pen, 
  865.                           IN const Graphics* g = NULL) const;
  866. protected:
  867.     GraphicsPath(const GraphicsPath& path)
  868.     {
  869.         GpPath *clonepath = NULL;
  870.         SetStatus(DllExports::GdipClonePath(path.nativePath, &clonepath));
  871.         SetNativePath(clonepath);
  872.     }
  873. #ifdef DCR_USE_NEW_250932
  874. private:
  875.     GraphicsPath& operator=(const GraphicsPath &);
  876. protected:
  877. #else
  878.     GraphicsPath& operator=(const GraphicsPath& path)
  879.     {
  880.         path;
  881.         SetStatus(NotImplemented);
  882.         return *this;
  883.     }
  884. #endif
  885.     GraphicsPath(GpPath* nativePath)
  886.     {
  887.         lastResult = Ok;
  888.         SetNativePath(nativePath);
  889.     }
  890.     VOID SetNativePath(GpPath *nativePath)
  891.     {
  892.         this->nativePath = nativePath;
  893.     }
  894.     Status SetStatus(Status status) const
  895.     {
  896.         if (status != Ok)
  897.             return (lastResult = status);
  898.         else
  899.             return status;
  900.     }
  901. protected:
  902.     GpPath* nativePath;
  903.     mutable Status lastResult;
  904. };
  905. //--------------------------------------------------------------------------
  906. // GraphisPathIterator class
  907. //--------------------------------------------------------------------------
  908. class GraphicsPathIterator : public GdiplusBase
  909. {
  910. public:
  911.     GraphicsPathIterator(IN const GraphicsPath* path)
  912.     {
  913.         GpPath* nativePath = NULL;
  914.         if(path)
  915.             nativePath = path->nativePath;
  916.         GpPathIterator *iter = NULL;
  917.         lastResult = DllExports::GdipCreatePathIter(&iter, nativePath);
  918.         SetNativeIterator(iter);
  919.     }
  920.     ~GraphicsPathIterator()
  921.     {
  922.         DllExports::GdipDeletePathIter(nativeIterator);
  923.     }
  924.     INT NextSubpath(OUT INT* startIndex,
  925.                     OUT INT* endIndex,
  926.                     OUT BOOL* isClosed)
  927.     {
  928.         INT resultCount;
  929.         SetStatus(DllExports::GdipPathIterNextSubpath(nativeIterator,
  930.             &resultCount, startIndex, endIndex, isClosed));
  931.         return resultCount;
  932.     }
  933.     INT NextSubpath(IN const GraphicsPath* path, 
  934.                     OUT BOOL* isClosed)
  935.     {
  936.         GpPath* nativePath = NULL;
  937.         INT resultCount;
  938.         if(path)
  939.             nativePath= path->nativePath;
  940.         SetStatus(DllExports::GdipPathIterNextSubpathPath(nativeIterator,
  941.             &resultCount, nativePath, isClosed));
  942.         return resultCount;
  943.     }
  944.     INT NextPathType(OUT BYTE* pathType, 
  945.                      OUT INT* startIndex, 
  946.                      OUT INT* endIndex)
  947.     {
  948.         INT resultCount;
  949.         SetStatus(DllExports::GdipPathIterNextPathType(nativeIterator,
  950.             &resultCount, pathType, startIndex, endIndex));
  951.         return resultCount;
  952.     }
  953.     INT NextMarker(OUT INT* startIndex, 
  954.                    OUT INT* endIndex)
  955.     {
  956.         INT resultCount;
  957.         SetStatus(DllExports::GdipPathIterNextMarker(nativeIterator,
  958.             &resultCount, startIndex, endIndex));
  959.         return resultCount;
  960.     }
  961.     INT NextMarker(IN const GraphicsPath* path)
  962.     {
  963.         GpPath* nativePath = NULL;
  964.         INT resultCount;
  965.         if(path)
  966.             nativePath= path->nativePath;
  967.         SetStatus(DllExports::GdipPathIterNextMarkerPath(nativeIterator,
  968.             &resultCount, nativePath));
  969.         return resultCount;
  970.     }
  971.     INT GetCount() const
  972.     {
  973.         INT resultCount;
  974.         SetStatus(DllExports::GdipPathIterGetCount(nativeIterator, &resultCount));
  975.         return resultCount;
  976.     }
  977.     INT GetSubpathCount() const
  978.     {
  979.         INT resultCount;
  980.         SetStatus(DllExports::GdipPathIterGetSubpathCount(nativeIterator, &resultCount));
  981.         return resultCount;
  982.     }
  983.     BOOL HasCurve() const
  984.     {
  985.         BOOL hasCurve;
  986.         SetStatus(DllExports::GdipPathIterHasCurve(nativeIterator, &hasCurve));
  987.         return hasCurve;
  988.     }
  989.     VOID Rewind()
  990.     {
  991.         SetStatus(DllExports::GdipPathIterRewind(nativeIterator));
  992.     }
  993.     INT Enumerate(OUT PointF *points,
  994.                   OUT BYTE *types, 
  995.                   IN INT count)
  996.     {
  997.         INT resultCount;
  998.         SetStatus(DllExports::GdipPathIterEnumerate(nativeIterator,
  999.             &resultCount, points, types, count));
  1000.         return resultCount;
  1001.     }
  1002.     INT CopyData(OUT PointF* points, 
  1003.                  OUT BYTE* types,
  1004.                  IN INT startIndex, 
  1005.                  IN INT endIndex)
  1006.     {
  1007.         INT resultCount;
  1008.         SetStatus(DllExports::GdipPathIterCopyData(nativeIterator,
  1009.             &resultCount, points, types, startIndex, endIndex));
  1010.         return resultCount;
  1011.     }
  1012.     Status GetLastStatus() const
  1013.     {
  1014.         Status lastStatus = lastResult;
  1015.         lastResult = Ok;
  1016.         return lastStatus;
  1017.     }
  1018. #ifdef DCR_USE_NEW_250932
  1019. private:
  1020.     GraphicsPathIterator(const GraphicsPathIterator &);
  1021.     GraphicsPathIterator& operator=(const GraphicsPathIterator &);
  1022. #endif
  1023. protected:
  1024.     VOID SetNativeIterator(GpPathIterator *nativeIterator)
  1025.     {
  1026.         this->nativeIterator = nativeIterator;
  1027.     }
  1028.     Status SetStatus(Status status) const
  1029.     {
  1030.         if (status != Ok)
  1031.             return (lastResult = status);
  1032.         else
  1033.             return status;
  1034.     }
  1035. protected:
  1036.     GpPathIterator* nativeIterator;
  1037.     mutable Status lastResult;
  1038. };
  1039. //--------------------------------------------------------------------------
  1040. // Represent polygon gradient brush object
  1041. //--------------------------------------------------------------------------
  1042. class PathGradientBrush : public Brush
  1043. {
  1044. public:
  1045.     friend class Pen;
  1046.     PathGradientBrush(
  1047.         IN const PointF* points,
  1048.         IN INT count,
  1049.         IN WrapMode wrapMode = WrapModeClamp)
  1050.     {
  1051.         GpPathGradient *brush = NULL;
  1052.         lastResult = DllExports::GdipCreatePathGradient(
  1053.                                         points, count,
  1054.                                         wrapMode, &brush);
  1055.         SetNativeBrush(brush);
  1056.     }
  1057.     PathGradientBrush(
  1058.         IN const Point* points,
  1059.         IN INT count,
  1060.         IN WrapMode wrapMode = WrapModeClamp)
  1061.     {
  1062.         GpPathGradient *brush = NULL;
  1063.         lastResult = DllExports::GdipCreatePathGradientI(
  1064.                                         points, count,
  1065.                                         wrapMode, &brush);
  1066.         SetNativeBrush(brush);
  1067.     }
  1068.     PathGradientBrush(
  1069.         IN const GraphicsPath* path
  1070.         )
  1071.     {
  1072.         GpPathGradient *brush = NULL;
  1073.         lastResult = DllExports::GdipCreatePathGradientFromPath(
  1074.                                         path->nativePath, &brush);
  1075.         SetNativeBrush(brush);
  1076.     }
  1077.     // Get/set colors
  1078.     Status GetCenterColor(OUT Color* color) const
  1079.     {
  1080.         ARGB argb;
  1081.         
  1082.         if (color == NULL) 
  1083.         {
  1084.             return SetStatus(InvalidParameter);
  1085.         }
  1086.         SetStatus(DllExports::GdipGetPathGradientCenterColor(
  1087.                        (GpPathGradient*) nativeBrush, &argb));
  1088.         color->SetValue(argb);
  1089.         return lastResult;
  1090.     }
  1091.     Status SetCenterColor(IN const Color& color)
  1092.     {
  1093.         SetStatus(DllExports::GdipSetPathGradientCenterColor(
  1094.                        (GpPathGradient*) nativeBrush,
  1095.                        color.GetValue()));
  1096.         return lastResult;
  1097.     }
  1098.     INT GetPointCount() const
  1099.     {
  1100.         INT count;
  1101.         SetStatus(DllExports::GdipGetPathGradientPointCount(
  1102.                        (GpPathGradient*) nativeBrush, &count));
  1103.         return count;
  1104.     }
  1105.     INT GetSurroundColorCount() const
  1106.     {
  1107.         INT count;
  1108.         SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
  1109.                        (GpPathGradient*) nativeBrush, &count));
  1110.         return count;
  1111.     }
  1112.     Status GetSurroundColors(OUT Color* colors, 
  1113.                              IN OUT INT* count) const
  1114.     {
  1115.         if(colors == NULL || count == NULL)
  1116.         {
  1117.             return SetStatus(InvalidParameter);
  1118.         }
  1119.         INT count1;
  1120.         
  1121.         SetStatus(DllExports::GdipGetPathGradientSurroundColorCount(
  1122.                         (GpPathGradient*) nativeBrush, &count1));
  1123.         if(lastResult != Ok)
  1124.             return lastResult;
  1125.         if((*count < count1) || (count1 <= 0))
  1126.             return SetStatus(InsufficientBuffer);
  1127.         ARGB* argbs = (ARGB*) new ARGB[count1];
  1128.         if(argbs == NULL)
  1129.             return SetStatus(OutOfMemory);
  1130.         SetStatus(DllExports::GdipGetPathGradientSurroundColorsWithCount(
  1131.                     (GpPathGradient*)nativeBrush, argbs, &count1));
  1132.         if(lastResult == Ok)
  1133.         {
  1134.             for(INT i = 0; i < count1; i++)
  1135.             {
  1136.                 colors[i].SetValue(argbs[i]);
  1137.             }        
  1138.             *count = count1;
  1139.         }
  1140.         delete [] argbs;
  1141.         return lastResult;
  1142.     }
  1143.     Status SetSurroundColors(IN const Color* colors, 
  1144.                              IN OUT INT* count)
  1145.     {
  1146.         if(colors == NULL || count == NULL)
  1147.         {
  1148.             return SetStatus(InvalidParameter);
  1149.         }
  1150.         INT count1 = GetPointCount();
  1151.         if((*count > count1) || (count1 <= 0))
  1152.             return SetStatus(InvalidParameter);
  1153.         count1 = *count;
  1154.         ARGB* argbs = (ARGB*) new ARGB[count1];
  1155.         if(argbs == NULL)
  1156.             return SetStatus(OutOfMemory);
  1157.         for(INT i = 0; i < count1; i++)
  1158.         {
  1159.             argbs[i] = colors[i].GetValue();
  1160.         }
  1161.         SetStatus(DllExports::GdipSetPathGradientSurroundColorsWithCount(
  1162.                     (GpPathGradient*)nativeBrush, argbs, &count1));
  1163.         if(lastResult == Ok)
  1164.             *count = count1;
  1165.         delete [] argbs;
  1166.         return lastResult;
  1167.     }
  1168.     Status GetGraphicsPath(OUT GraphicsPath* path) const
  1169.     {
  1170.         if(path == NULL)
  1171.             return SetStatus(InvalidParameter);
  1172.         return SetStatus(DllExports::GdipGetPathGradientPath(
  1173.                     (GpPathGradient*)nativeBrush, path->nativePath));
  1174.     }
  1175.     Status SetGraphicsPath(IN const GraphicsPath* path)
  1176.     {
  1177.         if(path == NULL)
  1178.             return SetStatus(InvalidParameter);
  1179.         return SetStatus(DllExports::GdipSetPathGradientPath(
  1180.                     (GpPathGradient*)nativeBrush, path->nativePath));
  1181.     }
  1182.     Status GetCenterPoint(OUT PointF* point) const
  1183.     {
  1184.         return SetStatus(DllExports::GdipGetPathGradientCenterPoint(
  1185.                                 (GpPathGradient*)nativeBrush,
  1186.                                 point));
  1187.     }
  1188.     Status GetCenterPoint(OUT Point* point) const
  1189.     {
  1190.         return SetStatus(DllExports::GdipGetPathGradientCenterPointI(
  1191.                                 (GpPathGradient*)nativeBrush,
  1192.                                 point));
  1193.     }
  1194.     Status SetCenterPoint(IN const PointF& point)
  1195.     {
  1196.         return SetStatus(DllExports::GdipSetPathGradientCenterPoint(
  1197.                                 (GpPathGradient*)nativeBrush,
  1198.                                 &point));
  1199.     }
  1200.     Status SetCenterPoint(IN const Point& point)
  1201.     {
  1202.         return SetStatus(DllExports::GdipSetPathGradientCenterPointI(
  1203.                                 (GpPathGradient*)nativeBrush,
  1204.                                 &point));
  1205.     }
  1206.     Status GetRectangle(OUT RectF* rect) const
  1207.     {
  1208.         return SetStatus(DllExports::GdipGetPathGradientRect(
  1209.                             (GpPathGradient*)nativeBrush, rect));
  1210.     }
  1211.     Status GetRectangle(OUT Rect* rect) const
  1212.     {
  1213.         return SetStatus(DllExports::GdipGetPathGradientRectI(
  1214.                             (GpPathGradient*)nativeBrush, rect));
  1215.     }
  1216.     // Gamma correction.
  1217.     Status SetGammaCorrection(IN BOOL useGammaCorrection)
  1218.     {
  1219.         return SetStatus(DllExports::GdipSetPathGradientGammaCorrection(
  1220.             (GpPathGradient*)nativeBrush, useGammaCorrection));
  1221.     }
  1222.     BOOL GetGammaCorrection() const
  1223.     {
  1224.         BOOL useGammaCorrection;
  1225.         SetStatus(DllExports::GdipGetPathGradientGammaCorrection(
  1226.             (GpPathGradient*)nativeBrush, &useGammaCorrection));
  1227.         return useGammaCorrection;
  1228.     }
  1229.     INT GetBlendCount() const
  1230.     {
  1231.        INT count = 0;
  1232.        SetStatus(DllExports::GdipGetPathGradientBlendCount(
  1233.                            (GpPathGradient*) nativeBrush, &count));
  1234.        return count;
  1235.     }
  1236.     Status GetBlend(OUT REAL* blendFactors,
  1237.                     OUT REAL* blendPositions,
  1238.                     IN INT count) const
  1239.     {
  1240.         return SetStatus(DllExports::GdipGetPathGradientBlend(
  1241.                             (GpPathGradient*)nativeBrush,
  1242.                             blendFactors, blendPositions, count));
  1243.     }
  1244.     Status SetBlend(IN const REAL* blendFactors, 
  1245.                     IN const REAL* blendPositions, 
  1246.                     IN INT count)
  1247.     {
  1248.         return SetStatus(DllExports::GdipSetPathGradientBlend(
  1249.                             (GpPathGradient*)nativeBrush,
  1250.                             blendFactors, blendPositions, count));
  1251.     }
  1252.     INT GetInterpolationColorCount() const
  1253.     {
  1254.        INT count = 0;
  1255.        SetStatus(DllExports::GdipGetPathGradientPresetBlendCount(
  1256.                         (GpPathGradient*) nativeBrush, &count));
  1257.        return count;
  1258.     }
  1259.     Status SetInterpolationColors(IN const Color* presetColors,
  1260.                                   IN const REAL* blendPositions, 
  1261.                                   IN INT count)
  1262.     {
  1263.         if ((count <= 0) || !presetColors) 
  1264.         {
  1265.             return SetStatus(InvalidParameter);
  1266.         }
  1267.         ARGB* argbs = (ARGB*) new ARGB[count];
  1268.         if(argbs)
  1269.         {
  1270.             for(INT i = 0; i < count; i++)
  1271.             {
  1272.                 argbs[i] = presetColors[i].GetValue();
  1273.             }
  1274.             Status status = SetStatus(DllExports::GdipSetPathGradientPresetBlend(
  1275.                                     (GpPathGradient*) nativeBrush,
  1276.                                     argbs,
  1277.                                     blendPositions,
  1278.                                     count));
  1279.             delete[] argbs;
  1280.             return status;
  1281.         }
  1282.         else
  1283.         {
  1284.             return SetStatus(OutOfMemory);
  1285.         }
  1286.     }
  1287.     Status GetInterpolationColors(OUT Color* presetColors,
  1288.                                   OUT REAL* blendPositions, 
  1289.                                   IN INT count) const
  1290.     {
  1291.         if ((count <= 0) || !presetColors) 
  1292.         {
  1293.             return SetStatus(InvalidParameter);
  1294.         }
  1295.         ARGB* argbs = (ARGB*) new ARGB[count];
  1296.         
  1297.         if (!argbs)
  1298.         {
  1299.             return SetStatus(OutOfMemory);
  1300.         }
  1301.         GpStatus status = SetStatus(DllExports::GdipGetPathGradientPresetBlend(
  1302.                                 (GpPathGradient*)nativeBrush,
  1303.                                 argbs,
  1304.                                 blendPositions,
  1305.                                 count));
  1306.         
  1307.         for(INT i = 0; i < count; i++)
  1308.         {
  1309.             presetColors[i] = Color(argbs[i]);
  1310.         }
  1311.         delete [] argbs;
  1312.         
  1313.         return status;
  1314.     }
  1315.     Status SetBlendBellShape(IN REAL focus, 
  1316.                              IN REAL scale = 1.0)
  1317.     {
  1318.         return SetStatus(DllExports::GdipSetPathGradientSigmaBlend(
  1319.                             (GpPathGradient*)nativeBrush, focus, scale));
  1320.     }
  1321.     #ifdef DCR_USE_NEW_145135
  1322.     Status SetBlendTriangularShape(
  1323.         IN REAL focus,
  1324.         IN REAL scale = 1.0
  1325.     )
  1326.     #else
  1327.     Status SetBlendTrianglarShape(IN REAL focus,
  1328.                                   IN REAL scale = 1.0)
  1329.     #endif                              
  1330.     {
  1331.         return SetStatus(DllExports::GdipSetPathGradientLinearBlend(
  1332.                             (GpPathGradient*)nativeBrush, focus, scale));
  1333.     }
  1334.     /**
  1335.      * Get/set brush transform
  1336.      */
  1337.     Status GetTransform(OUT Matrix *matrix) const
  1338.     {
  1339.         return SetStatus(DllExports::GdipGetPathGradientTransform(
  1340.                             (GpPathGradient*) nativeBrush, matrix->nativeMatrix));
  1341.     }
  1342.     Status SetTransform(IN const Matrix* matrix)
  1343.     {
  1344.         return SetStatus(DllExports::GdipSetPathGradientTransform(
  1345.                             (GpPathGradient*) nativeBrush, matrix->nativeMatrix));
  1346.     }
  1347.     Status ResetTransform()
  1348.     {
  1349.         return SetStatus(DllExports::GdipResetPathGradientTransform((GpPathGradient*)nativeBrush));
  1350.     }
  1351.     Status MultiplyTransform(IN const Matrix* matrix,
  1352.                              IN MatrixOrder order = MatrixOrderPrepend)
  1353.     {
  1354.         return SetStatus(DllExports::GdipMultiplyPathGradientTransform((GpPathGradient*)nativeBrush,
  1355.                                                                 matrix->nativeMatrix,
  1356.                                                                 order));
  1357.     }
  1358.     Status TranslateTransform(IN REAL dx, 
  1359.                               IN REAL dy,
  1360.                               IN MatrixOrder order = MatrixOrderPrepend)
  1361.     {
  1362.         return SetStatus(DllExports::GdipTranslatePathGradientTransform((GpPathGradient*)nativeBrush,
  1363.                                                                dx, dy, order));
  1364.     }
  1365.     Status ScaleTransform(IN REAL sx, 
  1366.                           IN REAL sy,
  1367.                           IN MatrixOrder order = MatrixOrderPrepend)
  1368.     {
  1369.         return SetStatus(DllExports::GdipScalePathGradientTransform((GpPathGradient*)nativeBrush,
  1370.                                                              sx, sy, order));
  1371.     }
  1372.     Status RotateTransform(IN REAL angle, 
  1373.                            IN MatrixOrder order = MatrixOrderPrepend)
  1374.     {
  1375.         return SetStatus(DllExports::GdipRotatePathGradientTransform((GpPathGradient*)nativeBrush,
  1376.                                                               angle, order));
  1377.     }
  1378.     /**
  1379.      * Get/set brush focus scales
  1380.      */
  1381.     Status GetFocusScales(OUT REAL* xScale, 
  1382.                           OUT REAL* yScale) const
  1383.     {
  1384.         return SetStatus(DllExports::GdipGetPathGradientFocusScales(
  1385.                             (GpPathGradient*) nativeBrush, xScale, yScale));
  1386.     }
  1387.     Status SetFocusScales(IN REAL xScale,
  1388.                           IN REAL yScale)
  1389.     {
  1390.         return SetStatus(DllExports::GdipSetPathGradientFocusScales(
  1391.                             (GpPathGradient*) nativeBrush, xScale, yScale));
  1392.     }
  1393.     /**
  1394.      * Get/set brush wrapping mode
  1395.      */
  1396.     WrapMode GetWrapMode() const
  1397.     {
  1398.         WrapMode wrapMode;
  1399.         SetStatus(DllExports::GdipGetPathGradientWrapMode(
  1400.                      (GpPathGradient*) nativeBrush, &wrapMode));
  1401.         return wrapMode;
  1402.     }
  1403.     Status SetWrapMode(IN WrapMode wrapMode)
  1404.     {
  1405.         return SetStatus(DllExports::GdipSetPathGradientWrapMode(
  1406.                             (GpPathGradient*) nativeBrush, wrapMode));
  1407.     }
  1408. #ifdef DCR_USE_NEW_250932
  1409. private:
  1410.     PathGradientBrush(const PathGradientBrush &);
  1411.     PathGradientBrush& operator=(const PathGradientBrush &);
  1412. #endif
  1413. protected:
  1414.     PathGradientBrush()
  1415.     {
  1416.     }
  1417. };
  1418. #endif // !_GRAPHICSPATH_HPP