示例#1
0
 public GpRectF(GpPointF location,
                GpSizeF size)
 {
     X      = location.X;
     Y      = location.Y;
     Width  = size.Width;
     Height = size.Height;
 }
示例#2
0
 public GpStatus AddBezier(GpPointF pt1,
                           GpPointF pt2,
                           GpPointF pt3,
                           GpPointF pt4)
 {
     return(AddBezier(pt1.X, pt1.Y, pt2.X, pt2.Y, pt3.X, pt3.Y, pt4.X,
                      pt4.Y));
 }
示例#3
0
        IsVisible(GpPointF point,
                  GraphicsPlus g)
        {
            bool booln = false;

            SetStatus(NativeMethods.GdipIsVisibleRegionPoint(nativeRegion,
                                                             point.X, point.Y,
                                                             (g == null) ? new GpGraphics() : g.nativeGraphics,
                                                             out booln));
            return(booln);
        }
示例#4
0
    Matrix( GpRectF rect, 
            GpPointF[] dstplg)
    {
        GpMatrix matrix;

        lastResult = NativeMethods.GdipCreateMatrix3(rect, 
                                                   dstplg,
                                                   out matrix);

        SetNativeMatrix(matrix);
    }
示例#5
0
文件: BrushPlus.cs 项目: mitice/foo
        public LinearGradientBrush(GpPointF point1,
                                   GpPointF point2,
                                   Color color1,
                                   Color color2)
        {
            GpLineGradient brush;

            lastResult = NativeMethods.GdipCreateLineBrush(ref point1,
                                                           ref point2,
                                                           color1.ToArgb(),
                                                           color2.ToArgb(),
                                                           WrapMode.WrapModeTile,
                                                           out brush);

            SetNativeBrush(brush);
        }
示例#6
0
 public GpStatus DrawImage(ImagePlus image,
                   GpPointF[] destPoints,
                  float srcx,
                  float srcy,
                  float srcwidth,
                  float srcheight,
                  Unit srcUnit,
                   ImageAttributesPlus imageAttributes)
 {
     return SetStatus(NativeMethods.GdipDrawImagePointsRect(nativeGraphics,
                                                          image != null ? image.nativeImage
                                                                : null,
                                                          destPoints, destPoints.Length,
                                                          srcx, srcy,
                                                          srcwidth,
                                                          srcheight,
                                                          srcUnit,
                                                          imageAttributes != null
                                                           ? imageAttributes.nativeImageAttr
                                                           : new GpImageAttributes(),
                                                          IntPtr.Zero,
                                                          IntPtr.Zero));
 }
示例#7
0
 //GpStatus
 //DrawString(
 //     string text,
 //     int           length,
 //     FontPlus         font,
 //     GpRectF        layoutRect,
 //     StringFormatPlus stringFormat,
 //     BrushPlus        brush
 //)
 //{
 //    return SetStatus(NativeMethods.GdipDrawString(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        layoutRect,
 //        stringFormat != null ? stringFormat.nativeFormat : null,
 //        brush != null? brush.nativeBrush : null
 //    ));
 //}
 //GpStatus
 //DrawString(
 //     string text,
 //    int                 length,
 //     FontPlus         font,
 //     GpPointF       origin,
 //     BrushPlus        brush
 //)
 //{
 //    GpRectF rect = new GpRectF(origin.X, origin.Y, 0.0f, 0.0f);
 //    return SetStatus(NativeMethods.GdipDrawString(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        rect,
 //        null,
 //        brush != null? brush.nativeBrush : null
 //    ));
 //}
 //GpStatus
 //DrawString(
 //     string text,
 //     int                 length,
 //     FontPlus         font,
 //     GpPointF       origin,
 //     StringFormatPlus stringFormat,
 //     BrushPlus        brush
 //)
 //{
 //    GpRectF rect = new GpRectF(origin.X, origin.Y, 0.0f, 0.0f);
 //    return SetStatus(NativeMethods.GdipDrawString(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        &rect,
 //        stringFormat != null? stringFormat.nativeFormat : null,
 //        brush != null? brush.nativeBrush : null
 //    ));
 //}
 //GpStatus
 //MeasureString(
 //     string text,
 //     int    length,
 //     FontPlus         font,
 //     GpRectF        layoutRect,
 //     StringFormatPlus stringFormat,
 //    out GpRectF             boundingBox,
 //    out int               codepointsFitted,
 //    out int               linesFilled
 //)
 //{
 //    return SetStatus(NativeMethods.GdipMeasureString(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        layoutRect,
 //        stringFormat != null? stringFormat.nativeFormat : null,
 //        boundingBox,
 //        codepointsFitted,
 //        linesFilled
 //    ));
 //}
 //GpStatus
 //MeasureString(
 //     string text,
 //    int                 length,
 //     FontPlus         font,
 //     GpSizeF        layoutRectSize,
 //     StringFormatPlus stringFormat,
 //    out GpSizeF             size,
 //    out int               codepointsFitted,
 //    out int               linesFilled
 //)
 //{
 //    GpRectF   layoutRect= new GpRectF(0, 0, layoutRectSize.Width, layoutRectSize.Height);
 //    GpRectF   boundingBox;
 //    GpStatus  status;
 //    if (size == null)
 //    {
 //        return SetStatus(InvalidParameter);
 //    }
 //    status = SetStatus(NativeMethods.GdipMeasureString(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        layoutRect,
 //        stringFormat != null? stringFormat.nativeFormat : null,
 //        size != null? boundingBox : null,
 //        codepointsFitted,
 //        linesFilled
 //    ));
 //    if (size != null && status == GpStatus.Ok)
 //    {
 //        size.Width  = boundingBox.Width;
 //        size.Height = boundingBox.Height;
 //    }
 //    return status;
 //}
 //GpStatus
 //MeasureString(
 //     string text,
 //    int                 length,
 //     FontPlus         font,
 //     GpPointF       origin,
 //     StringFormatPlus stringFormat,
 //    out GpRectF             boundingBox
 //)
 //{
 //    GpRectF rect = new GpRectF(origin.X, origin.Y, 0.0f, 0.0f);
 //    return SetStatus(NativeMethods.GdipMeasureString(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        out rect,
 //        stringFormat != null? stringFormat.nativeFormat : null,
 //        boundingBox,
 //        null,
 //        null
 //    ));
 //}
 //GpStatus
 //MeasureCharacterRanges(
 //    string text,
 //    int                 length,
 //     FontPlus         font,
 //     GpRectF        layoutRect,
 //     StringFormatPlus stringFormat,
 //    int                 regionCount,
 //    RegionPlus[]            regions
 //)
 //{
 //    if (!regions || regionCount <= 0)
 //    {
 //        return InvalidParameter;
 //    }
 //    GpRegion[] nativeRegions = new GpRegion [regionCount];
 //    for (int i = 0; i < regionCount; i++)
 //    {
 //        nativeRegions[i] = regions[i].nativeRegion;
 //    }
 //    GpStatus status = SetStatus(NativeMethods.GdipMeasureCharacterRanges(
 //        nativeGraphics,
 //        text,
 //        length,
 //        font != null? font.nativeFont : null,
 //        layoutRect,
 //        stringFormat != null? stringFormat.nativeFormat : null,
 //        regionCount,
 //        nativeRegions
 //    ));
 //    return status;
 //}
 public GpStatus DrawImage(ImagePlus image,
                   GpPointF point)
 {
     return DrawImage(image, point.X, point.Y);
 }
示例#8
0
 public GpStatus DrawCurve(PenPlus pen,
                   GpPointF[] points,
                  float tension)
 {
     return SetStatus(NativeMethods.GdipDrawCurve2(nativeGraphics,
                                                 pen.nativePen, points,
                                                 points.Length, tension));
 }
示例#9
0
 public GpStatus DrawBezier(PenPlus pen,
                    GpPointF pt1,
                    GpPointF pt2,
                    GpPointF pt3,
                    GpPointF pt4)
 {
     return DrawBezier(pen,
                       pt1.X,
                       pt1.Y,
                       pt2.X,
                       pt2.Y,
                       pt3.X,
                       pt3.Y,
                       pt4.X,
                       pt4.Y);
 }
示例#10
0
 public GpStatus FillPolygon(BrushPlus brush,
                     GpPointF[] points,
                    int count,
                    FillMode fillMode)
 {
     return SetStatus(NativeMethods.GdipFillPolygon(nativeGraphics,
                                                  brush.nativeBrush,
                                                  points, points.Length, fillMode));
 }
示例#11
0
文件: Paths.cs 项目: mitice/foo
 GdipGetPathLastPoint(GpPath path, out GpPointF lastPoint);
示例#12
0
GdipAddPathBeziers(GpPath path, GpPointF[] points, int count);
示例#13
0
 public bool Equals(GpPointF point)
 {
     return((X == point.X) && (Y == point.Y));
 }
示例#14
0
 public GpPointF(GpPointF point)
 {
     X = point.X;
     Y = point.Y;
 }
示例#15
0
文件: BrushPlus.cs 项目: mitice/foo
 public GpStatus SetCenterPoint(GpPointF point)
 {
     return(SetStatus(NativeMethods.GdipSetPathGradientCenterPoint(
                          (GpPathGradient)nativeBrush,
                          ref point)));
 }
示例#16
0
文件: BrushPlus.cs 项目: mitice/foo
 public GpStatus GetCenterPoint(out GpPointF point)
 {
     return(SetStatus(NativeMethods.GdipGetPathGradientCenterPoint(
                          (GpPathGradient)nativeBrush,
                          out point)));
 }
示例#17
0
GdipWarpPath(GpPath path, GpMatrix matrix,
            GpPointF[] points, int count,
            float srcx, float srcy, float srcwidth, float srcheight,
            WarpMode warpMode, float flatness);
示例#18
0
 public GpStatus GetLastPoint(out GpPointF lastPoint)
 {
     return(SetStatus(NativeMethods.GdipGetPathLastPoint(nativePath,
                                                         out lastPoint)));
 }
示例#19
0
GdipGetPathLastPoint(GpPath  path, out GpPointF lastPoint);
示例#20
0
 public bool IsOutlineVisible(GpPointF point,
                              PenPlus pen,
                              GraphicsPlus g)
 {
     return(IsOutlineVisible(point.X, point.Y, pen, g));
 }
示例#21
0
GdipAddPathCurve2(GpPath path, GpPointF[] points, int count,
                           float tension);
示例#22
0
 GdipSetPathGradientCenterPoint(
     GpPathGradient brush, ref GpPointF point);
示例#23
0
 public void GetLocation(out GpPointF point)
 {
     point.X = X;
     point.Y = Y;
 }
示例#24
0
 public bool Contains(GpPointF pt)
 {
     return(Contains(pt.X, pt.Y));
 }
示例#25
0
 GdipGetPathGradientCenterPoint(
     GpPathGradient brush, out GpPointF points);
示例#26
0
 public void Inflate(GpPointF point)
 {
     Inflate(point.X, point.Y);
 }
示例#27
0
        bool IsVisible(GpPointF point)
        {
            bool booln = false;

            SetStatus(NativeMethods.GdipIsVisiblePathPoint(new GpPath(),
                                                     point.X,
                                                     point.Y,
                                                     nativeGraphics,
                                                     out booln));

            return booln;
        }
示例#28
0
 public void Offset(GpPointF point)
 {
     Offset(point.X, point.Y);
 }
示例#29
0
 public GpStatus DrawClosedCurve(PenPlus pen,
                         GpPointF[] points)
 {
     return SetStatus(NativeMethods.GdipDrawClosedCurve(nativeGraphics,
                                                      pen.nativePen,
                                                      points, points.Length));
 }
示例#30
0
GdipFillPolygon2(GpGraphics graphics, GpBrush brush,
   GpPointF[] points, int count);
示例#31
0
 public GpStatus DrawCurve(PenPlus pen,
                   GpPointF[] points,
                  int offset,
                  int numberOfSegments,
                  float tension)
 {
     return SetStatus(NativeMethods.GdipDrawCurve3(nativeGraphics,
                                                 pen.nativePen, points,
                                                 points.Length, offset,
                                                 numberOfSegments, tension));
 }
示例#32
0
GdipFillClosedCurve(GpGraphics graphics, GpBrush brush,
                GpPointF[] points, int count);
示例#33
0
        public GpStatus DrawImage(ImagePlus image,
                          GpPointF[] destPoints)
        {
            int count = destPoints.Length;

            if (count != 3 && count != 4)
                return SetStatus(GpStatus.InvalidParameter);

            return SetStatus(NativeMethods.GdipDrawImagePoints(nativeGraphics,
                                                             image != null ? image.nativeImage
                                                                   : new GpImage(),
                                                             destPoints, count));
        }
示例#34
0
GdipFillClosedCurve2(GpGraphics graphics, GpBrush brush,
                GpPointF[] points, int count,
               float tension, FillMode fillMode);
示例#35
0
GdipAddPathPolygon(GpPath path, GpPointF[] points, int count);
示例#36
0
GdipDrawBeziers(GpGraphics graphics, GpPen pen, GpPointF[] points,
          int count);
示例#37
0
GdipGetPathPoints(GpPath path, GpPointF[] points, int count);
示例#38
0
GdipCreateMatrix3(GpRectF rect, GpPointF[] dstplg,
                       out GpMatrix matrix);
示例#39
0
GdipAddPathLine2(GpPath path, GpPointF[] points, int count);
示例#40
0
 /// <summary>
 ///   Searches the chart to find the index of the pie slice which 
 ///   contains point given. Search order goes in the direction opposite
 ///   to drawing order.
 /// </summary>
 /// <param name="point">
 ///   <c>PointF</c> point for which pie slice is searched for.
 /// </param>
 /// <returns>
 ///   Index of the corresponding pie slice, or -1 if none is found.
 /// </returns>
 public int FindPieSliceUnderPoint(GpPointF point)
 {
     // first check tops
     for (int i = 0; i < m_pieSlices.Length; ++i)
     {
         PieSlice slice = (PieSlice)m_pieSlices[i];
         if (slice.PieSliceContainsPoint(point))
             return (int)m_pieSlicesMapping[i];
     }
     // split the backmost (at 270 degrees) pie slice
     ArrayList pieSlicesList = new ArrayList(m_pieSlices);
     PieSlice[] splitSlices = m_pieSlices[0].Split(270F);
     if (splitSlices.Length > 1)
     {
         pieSlicesList[0] = splitSlices[1];
         if (splitSlices[0].SweepAngle > 0F)
         {
             pieSlicesList.Add(splitSlices[0]);
         }
     }
     PieSlice[] pieSlices = (PieSlice[])pieSlicesList.ToArray(typeof(PieSlice));
     int indexFound = -1;
     // if not found yet, then check for periferies
     int incrementIndex = 0;
     int decrementIndex = pieSlices.Length - 1;
     while (incrementIndex <= decrementIndex)
     {
         PieSlice sliceLeft = pieSlices[decrementIndex];
         float angle1 = 270 - sliceLeft.StartAngle;
         PieSlice sliceRight = pieSlices[incrementIndex];
         float angle2 = (sliceRight.EndAngle + 90) % 360;
         Debug.Assert(angle2 >= 0);
         if (angle2 < angle1)
         {
             if (sliceRight.PeripheryContainsPoint(point))
                 indexFound = incrementIndex;
             ++incrementIndex;
         }
         else
         {
             if (sliceLeft.PeripheryContainsPoint(point))
                 indexFound = decrementIndex;
             --decrementIndex;
         }
     }
     // check for start/stop sides, starting from the foremost
     if (indexFound < 0)
     {
         int foremostPieIndex = GetForemostPieSlice(pieSlices);
         // check for start sides from the foremost slice to the left 
         // side
         int i = foremostPieIndex;
         while (i < pieSlices.Length)
         {
             PieSlice sliceLeft = (PieSlice)pieSlices[i];
             if (sliceLeft.StartSideContainsPoint(point))
             {
                 indexFound = i;
                 break;
             }
             ++i;
         }
         // if not found yet, check end sides from the foremost to the right
         // side
         if (indexFound < 0)
         {
             i = foremostPieIndex;
             while (i >= 0)
             {
                 PieSlice sliceLeft = (PieSlice)pieSlices[i];
                 if (sliceLeft.EndSideContainsPoint(point))
                 {
                     indexFound = i;
                     break;
                 }
                 --i;
             }
         }
     }
     // finally search for bottom sides
     if (indexFound < 0)
     {
         for (int i = 0; i < m_pieSlices.Length; ++i)
         {
             PieSlice slice = (PieSlice)m_pieSlices[i];
             if (slice.BottomSurfaceSectionContainsPoint(point))
                 return (int)m_pieSlicesMapping[i];
         }
     }
     if (indexFound > -1)
     {
         indexFound %= (m_pieSlicesMapping.Count);
         return (int)m_pieSlicesMapping[indexFound];
     }
     return -1;
 }
示例#41
0
GdipAddPathCurve(GpPath path, GpPointF[] points, int count);
示例#42
0
 public GpStatus DrawLine(PenPlus pen,
                 GpPointF pt1,
                 GpPointF pt2)
 {
     return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
 }
示例#43
0
GdipAddPathCurve3(GpPath path, GpPointF[] points, int count,
                           int offset, int numberOfSegments, float tension);
示例#44
0
 public GpStatus FillClosedCurve(BrushPlus brush,
                         GpPointF[] points)
 {
     return SetStatus(NativeMethods.GdipFillClosedCurve(nativeGraphics,
                                                      brush.nativeBrush,
                                                      points, points.Length));
 }
示例#45
0
 public GpStatus AddLine(GpPointF pt1,
                         GpPointF pt2)
 {
     return(AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y));
 }
示例#46
0
 public GpStatus FillClosedCurve(BrushPlus brush,
                         GpPointF[] points,
                        FillMode fillMode,
                        float tension)
 {
     return SetStatus(NativeMethods.GdipFillClosedCurve2(nativeGraphics,
                                                       brush.nativeBrush,
                                                       points, points.Length,
                                                       tension, fillMode));
 }
示例#47
0
 public bool IsVisible(GpPointF point,
                       GraphicsPlus g)
 {
     return(IsVisible(point.X, point.Y, g));
 }
示例#48
0
 public GpStatus FillPolygon(BrushPlus brush,
                     GpPointF[] points)
 {
     return FillPolygon(brush, points, points.Length, FillMode.FillModeAlternate);
 }
示例#49
0
       IsVisible(GpPointF point,
                          GraphicsPlus g)
        {
            bool booln = false;

            SetStatus(NativeMethods.GdipIsVisibleRegionPoint(nativeRegion,
                                             point.X, point.Y,
                                             (g == null) ? new GpGraphics() : g.nativeGraphics,
                                             out booln));
            return booln;
        }
示例#50
0
 GdipCreateLineBrush(ref GpPointF point1,
                     ref GpPointF point2,
                     int color1, int color2,
                     WrapMode wrapMode,
                     out GpLineGradient lineGradient);