public GpRectF(GpPointF location, GpSizeF size) { X = location.X; Y = location.Y; Width = size.Width; Height = size.Height; }
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)); }
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); }
Matrix( GpRectF rect, GpPointF[] dstplg) { GpMatrix matrix; lastResult = NativeMethods.GdipCreateMatrix3(rect, dstplg, out matrix); SetNativeMatrix(matrix); }
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); }
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)); }
//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); }
public GpStatus DrawCurve(PenPlus pen, GpPointF[] points, float tension) { return SetStatus(NativeMethods.GdipDrawCurve2(nativeGraphics, pen.nativePen, points, points.Length, tension)); }
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); }
public GpStatus FillPolygon(BrushPlus brush, GpPointF[] points, int count, FillMode fillMode) { return SetStatus(NativeMethods.GdipFillPolygon(nativeGraphics, brush.nativeBrush, points, points.Length, fillMode)); }
GdipGetPathLastPoint(GpPath path, out GpPointF lastPoint);
GdipAddPathBeziers(GpPath path, GpPointF[] points, int count);
public bool Equals(GpPointF point) { return((X == point.X) && (Y == point.Y)); }
public GpPointF(GpPointF point) { X = point.X; Y = point.Y; }
public GpStatus SetCenterPoint(GpPointF point) { return(SetStatus(NativeMethods.GdipSetPathGradientCenterPoint( (GpPathGradient)nativeBrush, ref point))); }
public GpStatus GetCenterPoint(out GpPointF point) { return(SetStatus(NativeMethods.GdipGetPathGradientCenterPoint( (GpPathGradient)nativeBrush, out point))); }
GdipWarpPath(GpPath path, GpMatrix matrix, GpPointF[] points, int count, float srcx, float srcy, float srcwidth, float srcheight, WarpMode warpMode, float flatness);
public GpStatus GetLastPoint(out GpPointF lastPoint) { return(SetStatus(NativeMethods.GdipGetPathLastPoint(nativePath, out lastPoint))); }
public bool IsOutlineVisible(GpPointF point, PenPlus pen, GraphicsPlus g) { return(IsOutlineVisible(point.X, point.Y, pen, g)); }
GdipAddPathCurve2(GpPath path, GpPointF[] points, int count, float tension);
GdipSetPathGradientCenterPoint( GpPathGradient brush, ref GpPointF point);
public void GetLocation(out GpPointF point) { point.X = X; point.Y = Y; }
public bool Contains(GpPointF pt) { return(Contains(pt.X, pt.Y)); }
GdipGetPathGradientCenterPoint( GpPathGradient brush, out GpPointF points);
public void Inflate(GpPointF point) { Inflate(point.X, point.Y); }
bool IsVisible(GpPointF point) { bool booln = false; SetStatus(NativeMethods.GdipIsVisiblePathPoint(new GpPath(), point.X, point.Y, nativeGraphics, out booln)); return booln; }
public void Offset(GpPointF point) { Offset(point.X, point.Y); }
public GpStatus DrawClosedCurve(PenPlus pen, GpPointF[] points) { return SetStatus(NativeMethods.GdipDrawClosedCurve(nativeGraphics, pen.nativePen, points, points.Length)); }
GdipFillPolygon2(GpGraphics graphics, GpBrush brush, GpPointF[] points, int count);
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)); }
GdipFillClosedCurve(GpGraphics graphics, GpBrush brush, GpPointF[] points, int count);
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)); }
GdipFillClosedCurve2(GpGraphics graphics, GpBrush brush, GpPointF[] points, int count, float tension, FillMode fillMode);
GdipAddPathPolygon(GpPath path, GpPointF[] points, int count);
GdipDrawBeziers(GpGraphics graphics, GpPen pen, GpPointF[] points, int count);
GdipGetPathPoints(GpPath path, GpPointF[] points, int count);
GdipCreateMatrix3(GpRectF rect, GpPointF[] dstplg, out GpMatrix matrix);
GdipAddPathLine2(GpPath path, GpPointF[] points, int count);
/// <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; }
GdipAddPathCurve(GpPath path, GpPointF[] points, int count);
public GpStatus DrawLine(PenPlus pen, GpPointF pt1, GpPointF pt2) { return DrawLine(pen, pt1.X, pt1.Y, pt2.X, pt2.Y); }
GdipAddPathCurve3(GpPath path, GpPointF[] points, int count, int offset, int numberOfSegments, float tension);
public GpStatus FillClosedCurve(BrushPlus brush, GpPointF[] points) { return SetStatus(NativeMethods.GdipFillClosedCurve(nativeGraphics, brush.nativeBrush, points, points.Length)); }
public GpStatus AddLine(GpPointF pt1, GpPointF pt2) { return(AddLine(pt1.X, pt1.Y, pt2.X, pt2.Y)); }
public GpStatus FillClosedCurve(BrushPlus brush, GpPointF[] points, FillMode fillMode, float tension) { return SetStatus(NativeMethods.GdipFillClosedCurve2(nativeGraphics, brush.nativeBrush, points, points.Length, tension, fillMode)); }
public bool IsVisible(GpPointF point, GraphicsPlus g) { return(IsVisible(point.X, point.Y, g)); }
public GpStatus FillPolygon(BrushPlus brush, GpPointF[] points) { return FillPolygon(brush, points, points.Length, FillMode.FillModeAlternate); }
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; }
GdipCreateLineBrush(ref GpPointF point1, ref GpPointF point2, int color1, int color2, WrapMode wrapMode, out GpLineGradient lineGradient);