static SegmentedNumber() { fSevenSegment = new int[10, 7]{ {1,1,1,0,1,1,1}, {0,0,1,0,0,1,0}, {1,0,1,1,1,0,1}, {1,0,1,1,0,1,1}, {0,1,1,1,0,1,0}, {1,1,0,1,0,1,1}, {1,1,0,1,1,1,1}, {1,0,1,0,0,1,0}, {1,1,1,1,1,1,1}, {1,1,1,1,0,1,1}}; ptSegment = new Point2I[7][]; ptSegment[0] = new Point2I[] { new Point2I(7, 6), new Point2I(11, 2), new Point2I(31, 2), new Point2I(35, 6), new Point2I(31, 10), new Point2I(11, 10) }; ptSegment[1] = new Point2I[] { new Point2I(6, 7), new Point2I(10, 11), new Point2I(10, 31), new Point2I(6, 35), new Point2I(2, 31), new Point2I(2, 11) }; ptSegment[2] = new Point2I[] { new Point2I(36, 7), new Point2I(40, 11), new Point2I(40, 31), new Point2I(36, 35), new Point2I(32, 31), new Point2I(32, 11) }; ptSegment[3] = new Point2I[] { new Point2I(7, 36), new Point2I(11, 32), new Point2I(31, 32), new Point2I(35, 36), new Point2I(31, 40), new Point2I(11, 40) }; ptSegment[4] = new Point2I[] { new Point2I(6, 37), new Point2I(10, 41), new Point2I(10, 61), new Point2I(6, 65), new Point2I(2, 61), new Point2I(2, 41) }; ptSegment[5] = new Point2I[] { new Point2I(36, 37), new Point2I(40, 41), new Point2I(40, 61), new Point2I(36, 65), new Point2I(32, 61), new Point2I(32, 41) }; ptSegment[6] = new Point2I[] { new Point2I(7, 66), new Point2I(11, 62), new Point2I(31, 62), new Point2I(35, 66), new Point2I(31, 70), new Point2I(11, 70) }; }
public static GDIRegion CreateFromPolygon(Point2I[] points, PolygonFillMode aMode, Guid uniqueID) { TOAPI.Types.POINT[] pts = new POINT[points.Length]; for (int i = 0; i < pts.Length; i++) { pts[i].X = points[i].x; pts[i].Y = points[i].y; } IntPtr regionHandle = GDI32.CreatePolygonRgn(pts, pts.Length, (int)aMode); GDIRegion newRegion = new GDIRegion(regionHandle, true, uniqueID); return newRegion; }
public override void Polygon(Point2I[] pts) { Graphics.Polygon(pts); }
public override void PolyLine(Point2I[] pts) { Graphics.PolyLine(pts); }
public virtual void OnGraphicAdded(IGraphic aGraphic) { // Layout the graphic again LayoutHandler.AddToLayout(aGraphic); if (AutoGrow) { // Make sure our frame expands appropriately RectangleI frame = Frame; Point2I gOrigin = new Point2I(frame.Left + aGraphic.Frame.Left, frame.Top + aGraphic.Frame.Top); //float3 iPoint = WorldTransform.ApplyInverse(new float3(gOrigin.X, gOrigin.Y, 0)); //Point tOrigin = new Point((int)iPoint.x, (int)iPoint.y); RectangleI tRect = new RectangleI((int)gOrigin.x, (int)gOrigin.y, (int)aGraphic.Dimension.x, (int)aGraphic.Dimension.y); // WAA - need to do this frame = RectangleI.Union(frame, tRect); Dimension = new Vector3D(frame.Width, frame.Height); fFrame = frame; } }
Point2I[] GetPoints(PVertex[] pts) { Point2I[] r = new Point2I[pts.Length]; for (int i=0; i< pts.Length; i++) { r[i].x = (int)Math.Round(pts[i].x); r[i].y = (int)Math.Round(pts[i].y); } return r; }
//public abstract void StrokeRectangle(float x, float y, float width, float height); //public abstract void FillRectangle(float x, float y, float width, float height, color fillColor); //public abstract void StrokeAndFillRectangle(float x, float y, float width, float height, color fillColor); // Polygon public abstract void Polygon(Point2I[] pts);
public abstract void PolyLine(Point2I[] pts);
static extern bool GetCaretPos(ref Point2I aPoint);
public bool MoveTo(Point2I aPoint) { return MoveTo(aPoint.x, aPoint.y); }
// Polygon public override void Polygon(Point2I[] pts) { }
public override void PolyLine(Point2I[] pts) { }