Ejemplo n.º 1
0
 public GpRectF(GpPointF location,
                GpSizeF size)
 {
     X      = location.X;
     Y      = location.Y;
     Width  = size.Width;
     Height = size.Height;
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
    Matrix( GpRectF rect, 
            GpPointF[] dstplg)
    {
        GpMatrix matrix;

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

        SetNativeMatrix(matrix);
    }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 8
0
 public GpStatus DrawCurve(PenPlus pen,
                   GpPointF[] points,
                  float tension)
 {
     return SetStatus(NativeMethods.GdipDrawCurve2(nativeGraphics,
                                                 pen.nativePen, points,
                                                 points.Length, tension));
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 10
0
 public GpStatus FillPolygon(BrushPlus brush,
                     GpPointF[] points,
                    int count,
                    FillMode fillMode)
 {
     return SetStatus(NativeMethods.GdipFillPolygon(nativeGraphics,
                                                  brush.nativeBrush,
                                                  points, points.Length, fillMode));
 }
Ejemplo n.º 11
0
Archivo: Paths.cs Proyecto: mitice/foo
 GdipGetPathLastPoint(GpPath path, out GpPointF lastPoint);
Ejemplo n.º 12
0
GdipAddPathBeziers(GpPath path, GpPointF[] points, int count);
Ejemplo n.º 13
0
 public bool Equals(GpPointF point)
 {
     return((X == point.X) && (Y == point.Y));
 }
Ejemplo n.º 14
0
 public GpPointF(GpPointF point)
 {
     X = point.X;
     Y = point.Y;
 }
Ejemplo n.º 15
0
 public GpStatus SetCenterPoint(GpPointF point)
 {
     return(SetStatus(NativeMethods.GdipSetPathGradientCenterPoint(
                          (GpPathGradient)nativeBrush,
                          ref point)));
 }
Ejemplo n.º 16
0
 public GpStatus GetCenterPoint(out GpPointF point)
 {
     return(SetStatus(NativeMethods.GdipGetPathGradientCenterPoint(
                          (GpPathGradient)nativeBrush,
                          out point)));
 }
Ejemplo n.º 17
0
GdipWarpPath(GpPath path, GpMatrix matrix,
            GpPointF[] points, int count,
            float srcx, float srcy, float srcwidth, float srcheight,
            WarpMode warpMode, float flatness);
Ejemplo n.º 18
0
 public GpStatus GetLastPoint(out GpPointF lastPoint)
 {
     return(SetStatus(NativeMethods.GdipGetPathLastPoint(nativePath,
                                                         out lastPoint)));
 }
Ejemplo n.º 19
0
GdipGetPathLastPoint(GpPath  path, out GpPointF lastPoint);
Ejemplo n.º 20
0
 public bool IsOutlineVisible(GpPointF point,
                              PenPlus pen,
                              GraphicsPlus g)
 {
     return(IsOutlineVisible(point.X, point.Y, pen, g));
 }
Ejemplo n.º 21
0
GdipAddPathCurve2(GpPath path, GpPointF[] points, int count,
                           float tension);
Ejemplo n.º 22
0
 GdipSetPathGradientCenterPoint(
     GpPathGradient brush, ref GpPointF point);
Ejemplo n.º 23
0
 public void GetLocation(out GpPointF point)
 {
     point.X = X;
     point.Y = Y;
 }
Ejemplo n.º 24
0
 public bool Contains(GpPointF pt)
 {
     return(Contains(pt.X, pt.Y));
 }
Ejemplo n.º 25
0
 GdipGetPathGradientCenterPoint(
     GpPathGradient brush, out GpPointF points);
Ejemplo n.º 26
0
 public void Inflate(GpPointF point)
 {
     Inflate(point.X, point.Y);
 }
Ejemplo n.º 27
0
        bool IsVisible(GpPointF point)
        {
            bool booln = false;

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

            return booln;
        }
Ejemplo n.º 28
0
 public void Offset(GpPointF point)
 {
     Offset(point.X, point.Y);
 }
Ejemplo n.º 29
0
 public GpStatus DrawClosedCurve(PenPlus pen,
                         GpPointF[] points)
 {
     return SetStatus(NativeMethods.GdipDrawClosedCurve(nativeGraphics,
                                                      pen.nativePen,
                                                      points, points.Length));
 }
Ejemplo n.º 30
0
GdipFillPolygon2(GpGraphics graphics, GpBrush brush,
   GpPointF[] points, int count);
Ejemplo n.º 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));
 }
Ejemplo n.º 32
0
GdipFillClosedCurve(GpGraphics graphics, GpBrush brush,
                GpPointF[] points, int count);
Ejemplo n.º 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));
        }
Ejemplo n.º 34
0
GdipFillClosedCurve2(GpGraphics graphics, GpBrush brush,
                GpPointF[] points, int count,
               float tension, FillMode fillMode);
Ejemplo n.º 35
0
GdipAddPathPolygon(GpPath path, GpPointF[] points, int count);
Ejemplo n.º 36
0
GdipDrawBeziers(GpGraphics graphics, GpPen pen, GpPointF[] points,
          int count);
Ejemplo n.º 37
0
GdipGetPathPoints(GpPath path, GpPointF[] points, int count);
Ejemplo n.º 38
0
GdipCreateMatrix3(GpRectF rect, GpPointF[] dstplg,
                       out GpMatrix matrix);
Ejemplo n.º 39
0
GdipAddPathLine2(GpPath path, GpPointF[] points, int count);
Ejemplo n.º 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;
 }
Ejemplo n.º 41
0
GdipAddPathCurve(GpPath path, GpPointF[] points, int count);
Ejemplo n.º 42
0
 public GpStatus DrawLine(PenPlus pen,
                 GpPointF pt1,
                 GpPointF pt2)
 {
     return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y);
 }
Ejemplo n.º 43
0
GdipAddPathCurve3(GpPath path, GpPointF[] points, int count,
                           int offset, int numberOfSegments, float tension);
Ejemplo n.º 44
0
 public GpStatus FillClosedCurve(BrushPlus brush,
                         GpPointF[] points)
 {
     return SetStatus(NativeMethods.GdipFillClosedCurve(nativeGraphics,
                                                      brush.nativeBrush,
                                                      points, points.Length));
 }
Ejemplo n.º 45
0
 public GpStatus AddLine(GpPointF pt1,
                         GpPointF pt2)
 {
     return(AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 47
0
 public bool IsVisible(GpPointF point,
                       GraphicsPlus g)
 {
     return(IsVisible(point.X, point.Y, g));
 }
Ejemplo n.º 48
0
 public GpStatus FillPolygon(BrushPlus brush,
                     GpPointF[] points)
 {
     return FillPolygon(brush, points, points.Length, FillMode.FillModeAlternate);
 }
Ejemplo n.º 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;
        }
Ejemplo n.º 50
0
 GdipCreateLineBrush(ref GpPointF point1,
                     ref GpPointF point2,
                     int color1, int color2,
                     WrapMode wrapMode,
                     out GpLineGradient lineGradient);