示例#1
0
文件: PenPlus.cs 项目: misiek/foo
 public PenPlus(BrushPlus brush,
     float width)
 {
     Unit unit = Unit.UnitWorld;
     nativePen = null;
     lastResult = NativeMethods.GdipCreatePen2(brush.nativeBrush,
                                 width, unit, out nativePen);
 }
示例#2
0
        public PenPlus(BrushPlus brush,
                       float width)
        {
            Unit unit = Unit.UnitWorld;

            nativePen  = null;
            lastResult = NativeMethods.GdipCreatePen2(brush.nativeBrush,
                                                      width, unit, out nativePen);
        }
示例#3
0
        internal virtual BrushPlus Clone()
        {
            GpBrush brush = new GpBrush();

            SetStatus(NativeMethods.GdipCloneBrush(nativeBrush, out brush));

            BrushPlus newBrush = new BrushPlus(brush, lastResult);

            if (newBrush == null)
            {
                NativeMethods.GdipDeleteBrush(brush);
            }

            return newBrush;
        }
示例#4
0
文件: BrushPlus.cs 项目: mitice/foo
        internal virtual BrushPlus Clone()
        {
            GpBrush brush = new GpBrush();

            SetStatus(NativeMethods.GdipCloneBrush(nativeBrush, out brush));

            BrushPlus newBrush = new BrushPlus(brush, lastResult);

            if (newBrush == null)
            {
                NativeMethods.GdipDeleteBrush(brush);
            }

            return(newBrush);
        }
示例#5
0
 public GpStatus FillPie(BrushPlus brush,
                int x,
                int y,
                int width,
                int height,
                float startAngle,
                float sweepAngle)
 {
     return SetStatus(NativeMethods.GdipFillPieI(nativeGraphics,
                                               brush.nativeBrush,
                                               x,
                                               y,
                                               width,
                                               height,
                                               startAngle,
                                               sweepAngle));
 }
示例#6
0
 public GpStatus FillPie(BrushPlus brush,
                 GpRect rect,
                float startAngle,
                float sweepAngle)
 {
     return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height,
                    startAngle, sweepAngle);
 }
示例#7
0
 public GpStatus FillPath(BrushPlus brush,
                  GraphicsPath path)
 {
     return SetStatus(NativeMethods.GdipFillPath(nativeGraphics,
                                               brush.nativeBrush,
                                               path.nativePath));
 }
示例#8
0
 public GpStatus FillEllipse(BrushPlus brush,
                    float x,
                    float y,
                    float width,
                    float height)
 {
     return SetStatus(NativeMethods.GdipFillEllipse(nativeGraphics,
                                                  brush.nativeBrush, x, y,
                                                  width, height));
 }
示例#9
0
 public GpStatus FillRectangles(BrushPlus brush,
                        GpRect[] rects)
 {
     return SetStatus(NativeMethods.GdipFillRectanglesI(nativeGraphics,
                                                      brush.nativeBrush,
                                                      rects,
                                                      rects.Length));
 }
示例#10
0
 public GpStatus FillRectangle(BrushPlus brush,
                       GpRect rect)
 {
     return FillRectangle(brush,
                          rect.X,
                          rect.Y,
                          rect.Width,
                          rect.Height);
 }
示例#11
0
 public GpStatus SetBrush(BrushPlus brush)
 {
     return(SetStatus(NativeMethods.GdipSetPenBrushFill(nativePen,
                                                        brush.nativeBrush)));
 }
示例#12
0
 /// <summary>
 ///   Draws the <c>Quadrilateral</c> with <c>Graphics</c> provided.
 /// </summary>
 /// <param name="graphics">
 ///   <c>Graphics</c> used to draw.
 /// </param>
 /// <param name="pen">
 ///   <c>Pen</c> used to draw outline.
 /// </param>
 /// <param name="brush">
 ///   <c>Brush</c> used to fill the inside. 
 /// </param>
 public void Draw(GraphicsPlus graphics, PenPlus pen, BrushPlus brush)
 {
     graphics.FillPath(brush, m_path);
     graphics.DrawPath(pen, m_path);
 }
示例#13
0
文件: PenPlus.cs 项目: misiek/foo
 public GpStatus SetBrush(BrushPlus brush)
 {
     return SetStatus(NativeMethods.GdipSetPenBrushFill(nativePen,
                                    brush.nativeBrush));
 }
示例#14
0
 public GpStatus FillPolygon(BrushPlus brush,
                     GpPoint[] points)
 {
     return FillPolygon(brush, points, FillMode.FillModeAlternate);
 }
示例#15
0
 public GpStatus FillClosedCurve(BrushPlus brush,
                         GpPoint[] points)
 {
     return SetStatus(NativeMethods.GdipFillClosedCurveI(nativeGraphics,
                                                       brush.nativeBrush,
                                                       points,
                                                       points.Length));
 }
示例#16
0
 public GpStatus FillPolygon(BrushPlus brush,
                     GpPoint[] points,
                    FillMode fillMode)
 {
     return SetStatus(NativeMethods.GdipFillPolygonI(nativeGraphics,
                                                   brush.nativeBrush,
                                                   points, points.Length,
                                                   fillMode));
 }
示例#17
0
 public GpStatus FillClosedCurve(BrushPlus brush,
                         GpPoint[] points,
                        FillMode fillMode,
                        float tension)
 {
     return SetStatus(NativeMethods.GdipFillClosedCurve2I(nativeGraphics,
                                                        brush.nativeBrush,
                                                        points, points.Length,
                                                        tension, fillMode));
 }
示例#18
0
 public GpStatus FillRectangle(BrushPlus brush,
                      int x,
                      int y,
                      int width,
                      int height)
 {
     return SetStatus(NativeMethods.GdipFillRectangleI(nativeGraphics,
                                                     brush.nativeBrush,
                                                     x,
                                                     y,
                                                     width,
                                                     height));
 }
示例#19
0
 public GpStatus FillEllipse(BrushPlus brush,
                     GpRectF rect)
 {
     return FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);
 }
示例#20
0
 public GpStatus FillRegion(BrushPlus brush,
                    RegionPlus region)
 {
     return SetStatus(NativeMethods.GdipFillRegion(nativeGraphics,
                                                 brush.nativeBrush,
                                                 region.nativeRegion));
 }
示例#21
0
 /// <summary>
 ///   Draws the outer periphery of the pie slice.
 /// </summary>
 /// <param name="graphics">
 ///   <c>Graphics</c> object used to draw the surface.
 /// </param>
 /// <param name="pen">
 ///   <c>Pen</c> used to draw outline.
 /// </param>
 /// <param name="brush">
 ///   <c>Brush</c> used to fill the quadrilateral.
 /// </param>
 /// <param name="boundingRect">
 ///   Bounding rectangle that is used to draw the top surface of the 
 ///   pie slice.
 /// </param>
 /// <param name="startAngle">
 ///   Start angle (in degrees) of the periphery section.
 /// </param>
 /// <param name="endAngle">
 ///   End angle (in degrees) of the periphery section.
 /// </param>
 /// <param name="pointStart">
 ///   Point representing the start of the periphery.
 /// </param>
 /// <param name="pointEnd">
 ///   Point representing the end of the periphery.
 /// </param>
 protected void DrawCylinderSurfaceSection(GraphicsPlus graphics, PenPlus pen, BrushPlus brush, float startAngle, float endAngle, GpPointF pointStart, GpPointF pointEnd)
 {
     GraphicsPath path = CreatePathForCylinderSurfaceSection(startAngle, endAngle, pointStart, pointEnd);
     graphics.FillPath(brush, path);
     graphics.DrawPath(pen, path);
 }