当前位置: 首页>>代码示例>>C#>>正文


C# GraphicsPath.IsOutlineVisible方法代码示例

本文整理汇总了C#中System.Drawing.Drawing2D.GraphicsPath.IsOutlineVisible方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsPath.IsOutlineVisible方法的具体用法?C# GraphicsPath.IsOutlineVisible怎么用?C# GraphicsPath.IsOutlineVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Drawing.Drawing2D.GraphicsPath的用法示例。


在下文中一共展示了GraphicsPath.IsOutlineVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClickableAt

        public override bool ClickableAt(int x, int y)
        {
            Rectangle rect = GuiRectangle.GetGuiRectangle(Left, Top, Width, Height);
            int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS) + 10;
            Color fillColor = GetFieldValueAsColor(FieldType.FILL_COLOR);

            // If we clicked inside the rectangle and it's visible we are clickable at.
            if (!Color.Transparent.Equals(fillColor))
            {
                if (Contains(x, y))
                {
                    return true;
                }
            }

            // check the rest of the lines
            if (lineThickness > 0)
            {
                using (Pen pen = new Pen(Color.White, lineThickness))
                {
                    using (GraphicsPath path = new GraphicsPath())
                    {
                        path.AddEllipse(rect);
                        return path.IsOutlineVisible(x, y, pen);
                    }
                }
            }
            else
            {
                return false;
            }
        }
开发者ID:modulexcite,项目名称:ShareX_Google_Code,代码行数:32,代码来源:EllipseContainer.cs

示例2: HitTest

		public bool HitTest(Point p)
		{
			GraphicsPath gp = new GraphicsPath();
			Matrix mtx = new Matrix();
			Pen pen = new Pen(el.BorderColor, el.BorderWidth + 4);
			pen.StartCap = el.StartCap;
			pen.EndCap = el.EndCap;
			gp.AddLine(el.Point1, el.Point2);
			gp.Transform(mtx);
			//Rectangle retGp = Rectangle.Round(gp.GetBounds());
			return gp.IsOutlineVisible (p, pen);
		}
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:12,代码来源:LineController.cs

示例3: ClickableAt

 public override bool ClickableAt(int x, int y)
 {
     int lineThickness = GetFieldValueAsInt(FieldType.LINE_THICKNESS) +5;
     if (lineThickness > 0) {
         using (Pen pen = new Pen(Color.White)) {
             pen.Width = lineThickness;
             GraphicsPath path = new GraphicsPath();
             path.AddLine(this.Left, this.Top, this.Left + this.Width, this.Top + this.Height);
             return path.IsOutlineVisible(x,y, pen);
         }
     } else {
         return false;
     }
 }
开发者ID:eservicepartner,项目名称:espUrl,代码行数:14,代码来源:LineContainer.cs

示例4: PointInBox

		/// <summary>
		/// Determine if the specified screen point lies inside the bounding box of this
		/// <see cref="LineObj"/>.
		/// </summary>
		/// <remarks>The bounding box is calculated assuming a distance
		/// of <see cref="GraphPane.Default.NearestTol"/> pixels around the arrow segment.
		/// </remarks>
		/// <param name="pt">The screen point, in pixels</param>
		/// <param name="pane">
		/// A reference to the <see cref="PaneBase"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <param name="g">
		/// A graphic device object to be drawn into.  This is normally e.Graphics from the
		/// PaintEventArgs argument to the Paint() method.
		/// </param>
		/// <param name="scaleFactor">
		/// The scaling factor to be used for rendering objects.  This is calculated and
		/// passed down by the parent <see cref="GraphPane"/> object using the
		/// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
		/// font sizes, etc. according to the actual size of the graph.
		/// </param>
		/// <returns>true if the point lies in the bounding box, false otherwise</returns>
		override public bool PointInBox( PointF pt, PaneBase pane, Graphics g, float scaleFactor )
		{
			if ( ! base.PointInBox(pt, pane, g, scaleFactor ) )
				return false;

			// transform the x,y location from the user-defined
			// coordinate frame to the screen pixel location
			PointF pix = _location.TransformTopLeft( pane );
			PointF pix2 = _location.TransformBottomRight( pane );

            float tolerance = (float)GraphPane.Default.NearestTol * 2.0F;
            // nicksh: "GraphicsPath.IsOutlineVisible" can be slow, so do a first check to see if 
            // the point is at all near this Line.
		    var boundingBox = new RectangleF(Math.Min(pix.X, pix2.X), Math.Min(pix.Y, pix2.Y), 
                                             Math.Abs(pix.X - pix2.X), Math.Abs(pix.Y - pix2.Y));
            boundingBox.Inflate(tolerance, tolerance);
            if (!boundingBox.Contains(pt))
            {
                return false;
            }

			using ( Pen pen = new Pen( Color.Black, tolerance))
			{
				using ( GraphicsPath path = new GraphicsPath() )
				{
					path.AddLine( pix, pix2 );
					return path.IsOutlineVisible( pt, pen );
				}
			}
		}
开发者ID:lgatto,项目名称:proteowizard,代码行数:53,代码来源:LineObj.cs

示例5: GetPathIntercept

		//Gets the path intercept of a line drawn from inside a graphicspath outwards
		//Path should be flattened before passing to this procedure
		public static PointF GetPathIntercept(PointF startPoint,PointF endPoint,GraphicsPath path,Pen outlinePen,RectangleF internalRectangle)
		{
			float x = 0;
			float y = 0;
			float xStep;
			float yStep;

			bool useInternal;
			//useInternal = ! internalRectangle.IsEmpty;
			useInternal = false;

			//work out interval in steps
			xStep = ((startPoint.X <= endPoint.X) ? 1.0F : -1.0F);
			yStep = ((startPoint.Y <= endPoint.Y) ? 1.0F : -1.0F);

			float gradient = (endPoint.Y - startPoint.Y) / (endPoint.X - startPoint.X);
			float reverseGradient = 1 / gradient;

			//Loop making smaller and smaller step adjustments, longer processing time but more accuracy
			while (xStep != 0)
			{
				//Check for vertical line
				if (startPoint.X != endPoint.X)
				{
					//Step through each value of x, determining y and checking if outline visible
					for (x = startPoint.X; ((startPoint.X < endPoint.X) ? x <= endPoint.X : x >= endPoint.X); x += xStep)
					{
						//calculate Y
						//y = Convert.ToSingle((gradient * (x - startPoint.X)) + startPoint.Y);
						y = (gradient * (x - startPoint.X)) + startPoint.Y;

						//check if we have hit the outline 
						if (path.IsOutlineVisible(x, y, outlinePen)) return new PointF(x, y);
						if (useInternal && internalRectangle.Contains(x,y)) break;
					}
				}
				//Try stepping through each value of y, this is for a line with a high gradient
				//where a small change in x produces a large change in y
				//therefore try small changes in y and work out x

				//Step through each value of y, determining x and checking if outline visible
				if (startPoint.Y != endPoint.Y)
				{
					for (y = startPoint.Y; ((startPoint.Y < endPoint.Y) ? y <= endPoint.Y : y >= endPoint.Y); y += yStep)
					{
						//calculate X
						//x = Convert.ToSingle((reverseGradient * (y - startPoint.Y) + startPoint.X));
						x = (reverseGradient * (y - startPoint.Y) + startPoint.X);

						//check if we have hit the outline 
						if (path.IsOutlineVisible(x, y, outlinePen)) return new PointF(x, y);
						if (useInternal && internalRectangle.Contains(x,y)) break;
					}
				}

				//Make smaller steps if havent found intercept
				xStep += ((startPoint.X <= endPoint.X)? -0.25F : 0.25F);
				yStep += ((startPoint.Y <= endPoint.Y)? -0.25F : 0.25F);
			}

			return startPoint;
		}
开发者ID:savagemat,项目名称:arcgis-diagrammer,代码行数:64,代码来源:Geometry.cs

示例6: PointInBox

        /// <summary>
        /// Determine if the specified screen point lies inside the bounding box of this
        /// <see cref="LineObj"/>.
        /// </summary>
        /// <remarks>The bounding box is calculated assuming a distance
        /// of <see cref="GraphPane.Default.NearestTol"/> pixels around the arrow segment.
        /// </remarks>
        /// <param name="pt">The screen point, in pixels</param>
        /// <param name="pane">
        /// A reference to the <see cref="PaneBase"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see cref="GraphPane"/> object using the
        /// <see cref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param>
        /// <returns>true if the point lies in the bounding box, false otherwise</returns>
        public override bool PointInBox(PointF pt, PaneBase pane, Graphics g, float scaleFactor)
        {
            if (! base.PointInBox(pt, pane, g, scaleFactor))
                return false;

            // transform the x,y location from the user-defined
            // coordinate frame to the screen pixel location
            PointF pix = _location.TransformTopLeft(pane);
            PointF pix2 = _location.TransformBottomRight(pane);

            using (var pen = new Pen(Color.Black, (float) GraphPane.Default.NearestTol*2.0F))
            {
                using (var path = new GraphicsPath())
                {
                    path.AddLine(pix, pix2);
                    return path.IsOutlineVisible(pt, pen);
                }
            }
        }
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:42,代码来源:LineObj.cs

示例7: IsOutlineVisible_Line_End

		[Category ("NotWorking")] // looks buggy - reported to MS as FDBK50868
		public void IsOutlineVisible_Line_End ()
		{
			// horizontal line
			using (GraphicsPath gp = new GraphicsPath ()) {
				gp.AddLine (10, 1, 14, 1);
				Assert.IsFalse (gp.IsOutlineVisible (14, 1, Pens.Red, null), "Int1h");
				Assert.IsFalse (gp.IsOutlineVisible (13.5f, 1.0f, Pens.Red, null), "Float1h");
				Assert.IsTrue (gp.IsOutlineVisible (13.4f, 1.0f, Pens.Red, null), "Float2h");
				Assert.IsFalse (gp.IsOutlineVisible (new Point (14, 1), Pens.Red, null), "Point1h");
				Assert.IsFalse (gp.IsOutlineVisible (new PointF (13.5f, 1.0f), Pens.Red, null), "PointF1h");
				Assert.IsTrue (gp.IsOutlineVisible (new PointF (13.49f, 1.0f), Pens.Red, null), "PointF2h");
			}
			// vertical line
			using (GraphicsPath gp = new GraphicsPath ()) {
				gp.AddLine (1, 10, 1, 14);
				Assert.IsFalse (gp.IsOutlineVisible (1, 14, Pens.Red, null), "Int1v");
				Assert.IsFalse (gp.IsOutlineVisible (1.0f, 13.5f, Pens.Red, null), "Float1v");
				Assert.IsTrue (gp.IsOutlineVisible (1.0f, 13.4f, Pens.Red, null), "Float2v");
				Assert.IsFalse (gp.IsOutlineVisible (new Point (1, 14), Pens.Red, null), "Point1v");
				Assert.IsFalse (gp.IsOutlineVisible (new PointF (1.0f, 13.5f), Pens.Red, null), "PointF1v");
				Assert.IsTrue (gp.IsOutlineVisible (new PointF (1.0f, 13.49f), Pens.Red, null), "PointF2v");
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:24,代码来源:GraphicsPathTest.cs

示例8: IsOutlineVisible_Line

		private void IsOutlineVisible_Line (Graphics graphics)
		{
			Pen p2 = new Pen (Color.Red, 3.0f);
			using (GraphicsPath gp = new GraphicsPath ()) {
				gp.AddLine (10, 1, 14, 1);
				Assert.IsTrue (gp.IsOutlineVisible (10, 1, Pens.Red, graphics), "Int1");
				Assert.IsTrue (gp.IsOutlineVisible (10, 2, p2, graphics), "Int2");
				Assert.IsFalse (gp.IsOutlineVisible (10, 2, Pens.Red, graphics), "Int3");

				Assert.IsTrue (gp.IsOutlineVisible (11.0f, 1.0f, Pens.Red, graphics), "Float1");
				Assert.IsTrue (gp.IsOutlineVisible (11.0f, 1.0f, p2, graphics), "Float2");
				Assert.IsFalse (gp.IsOutlineVisible (11.0f, 2.0f, Pens.Red, graphics), "Float3");

				Point pt = new Point (12, 2);
				Assert.IsFalse (gp.IsOutlineVisible (pt, Pens.Red, graphics), "Point1");
				Assert.IsTrue (gp.IsOutlineVisible (pt, p2, graphics), "Point2");
				pt.Y = 1;
				Assert.IsTrue (gp.IsOutlineVisible (pt, Pens.Red, graphics), "Point3");

				PointF pf = new PointF (13.0f, 2.0f);
				Assert.IsFalse (gp.IsOutlineVisible (pf, Pens.Red, graphics), "PointF1");
				Assert.IsTrue (gp.IsOutlineVisible (pf, p2, graphics), "PointF2");
				pf.Y = 1;
				Assert.IsTrue (gp.IsOutlineVisible (pf, Pens.Red, graphics), "PointF3");
			}
			p2.Dispose ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:27,代码来源:GraphicsPathTest.cs

示例9: HitTest

		/// <summary>
		/// Performs a hit test on the <see cref="Graphic"/> at a given point.
		/// </summary>
		/// <param name="point">The mouse position in destination coordinates.</param>
		/// <returns>
		/// <b>True</b> if <paramref name="point"/> "hits" the <see cref="Graphic"/>,
		/// <b>false</b> otherwise.
		/// </returns>
		public override bool HitTest(Point point)
		{
			base.CoordinateSystem = CoordinateSystem.Destination;
			try
			{
				using (var gp = new GraphicsPath())
				using (var pen = new Pen(Color.Black, HitTestDistance))
				{
					PointF[] pathPoints = GetCurvePoints(_points);
					if (_points.IsClosed)
						gp.AddClosedCurve(pathPoints);
					else
						gp.AddCurve(pathPoints);
					return gp.IsOutlineVisible(point, pen);
				}
			}
			finally
			{
				base.ResetCoordinateSystem();
			}
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:29,代码来源:SplinePrimitive.cs

示例10: OnMouseMove

        public void OnMouseMove(MouseEventArgs e)
        {
            if (this.graph == null )
            {
                this.Operate = PolyOperate.Draw;
                return;
            }
            if (((SvgElement) this.graph).ParentNode == null)
            {
                this.Operate = PolyOperate.Draw;
                return;
            }
            if ((Control.ModifierKeys & Keys.Control) == Keys.Control || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom11) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom14) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom15))
            {
                addBegin =false;
                addEnd =false;
            }
            if (isKeydown((int)ItopVector.Core.Win32.Enum.VirtualKeys.VK_B) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom13))
            {
                addBegin =true;
                addEnd =false;
            }
            else if (isKeydown((int)ItopVector.Core.Win32.Enum.VirtualKeys.VK_E) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom12))
            {
                addEnd =true;
                addBegin=false;
            }
            if(addEnd || addBegin)
            {
                this.Operate = PolyOperate.Draw;
                return;
            }
            if (e.Button == MouseButtons.None)
            {
                this.win32.hdc = this.win32.W32GetDC(this.mouseAreaControl.Handle);
                this.win32.W32SetROP2(7);
                this.win32.W32PolyDraw(this.reversePath);
                this.reversePath.Reset();
                this.win32.ReleaseDC();
                int num4;
                PointF[] tfArray1 = (PointF[]) this.points.Clone();
                int num1 = 0;
                this.insertindex = num4 = -1;
                this.moveindex = num4;
                GraphicsPath path1 = new GraphicsPath();
                Pen pen1 = new Pen(Color.Beige, 4f);
                PointF[] tfArray3 = tfArray1;
                for (int num5 = 0; num5 < tfArray3.Length; num5++)
                {
                    PointF tf1 = tfArray3[num5];
                    RectangleF ef1 = new RectangleF(tf1.X - 2f, tf1.Y - 2f, 4f, 4f);
                    if (ef1.Contains((PointF) new Point(e.X, e.Y)))
                    {
                        this.moveindex = num1;
                        if ((Control.ModifierKeys & Keys.Control) == Keys.Control || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom11) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom14))
                        {
                            if (((Control.ModifierKeys & Keys.Alt) == Keys.Alt || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom11)) && this.graph is Polyline && num5 > 0 && num5 < tfArray3.Length-1 && (this.mouseAreaControl.CurrentOperation != ToolOperation.Custom14))
                            {
            //								PointF[] tfs=new PointF[num5];
            //								for(int i=0;i<num5;i++)
            //								{
            //									tfs[i] = tfArray1[i];
            //								}
            //								((Polyline) this.graph).Points = tfs;
                                this.Operate = PolyOperate.Break;
                                return;
                            }
                            else
                            {
                                this.Operate = PolyOperate.Del;
                                return;
                            }
                        }
                        this.Operate = PolyOperate.MovePoint;
                        return;

                    }
                    if ((num1 - 1) >= 0)
                    {
                        path1.Reset();
                        PointF tf2 = tfArray1[num1 - 1];
                        path1.AddLine(tf2, tf1);
                        if (path1.IsOutlineVisible(new PointF((float) e.X, (float) e.Y), pen1))
                        {
                            if (((Control.ModifierKeys & Keys.Control) == Keys.Control) || (this.mouseAreaControl.CurrentOperation == ToolOperation.Custom15))

                            {
                                this.Operate = PolyOperate.Add;
                            }
                            else
                            {
                                this.Operate = PolyOperate.MovePath;
                            }
                            this.insertindex = num1;
                            return;
                        }
                    }
                    if (((num1 == (tfArray1.Length - 1)) && (this.mouseAreaControl.CurrentOperation == ToolOperation.Polygon)) && (tfArray1.Length >= 3))
                    {
                        path1.Reset();
//.........这里部分代码省略.........
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:101,代码来源:PolyOperation.cs

示例11: IsOutlineVisible_Point_Pen_Graphics

		public void IsOutlineVisible_Point_Pen_Graphics()
		{
			path = new GraphicsPath ();
			path.AddRectangle (new RectangleF (10f, 10f, 300f, 300f));
			
			path.StartFigure();
			path.AddRectangle (new RectangleF (150f, 10f, 50f, 400f));

			Pen pen = new Pen (Color.Red, 5);
			Graphics gr = Graphics.FromImage (new Bitmap (512, 512));
			gr.Clip = new Region (new Rectangle ( 5, 5, 500, 50));

			Assert.IsFalse (path.IsOutlineVisible (new Point (0, 0), pen, gr));

			Assert.IsFalse (path.IsOutlineVisible (new Point (40, 40), pen, gr));

			Assert.IsTrue (path.IsOutlineVisible (new Point (9, 9), pen, gr));

			Assert.IsFalse (path.IsOutlineVisible (new Point (400, 400), pen, gr));

			Assert.IsTrue (path.IsOutlineVisible (new Point (312, 312), pen, gr));

			Assert.IsFalse (path.IsOutlineVisible (new Point (313, 313), pen, gr));

			Assert.IsTrue (path.IsOutlineVisible (new Point (310, 10), pen, gr));
			Assert.IsTrue (path.IsOutlineVisible (new Point (310, 10), pen, null));

			Assert.IsTrue (path.IsOutlineVisible (new Point (310, 210), pen, gr));
			Assert.IsTrue (path.IsOutlineVisible (new Point (310, 210), pen, null));

			//t.AssertCompare ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:32,代码来源:GraphicsPath.cs

示例12: IsOutlineVisible_Point_Pen

		public void IsOutlineVisible_Point_Pen()
		{				
			path = new GraphicsPath ();
			path.AddRectangle (new RectangleF (10f, 10f, 300f, 300f));
			
			path.StartFigure();
			path.AddRectangle (new RectangleF (150f, 10f, 50f, 400f));

			Pen pen = new Pen (Color.Red, 5);

			Assert.IsFalse (path.IsOutlineVisible (new Point (0, 0), pen));

			Assert.IsFalse (path.IsOutlineVisible (new Point (40, 40), pen));

			Assert.IsTrue (path.IsOutlineVisible (new Point (9, 9), pen));

			Assert.IsFalse (path.IsOutlineVisible (new Point (400, 400), pen));

			Assert.IsTrue (path.IsOutlineVisible (new Point (312, 312), pen));

			Assert.IsFalse (path.IsOutlineVisible (new Point (313, 313), pen));

			//t.AssertCompare ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:24,代码来源:GraphicsPath.cs

示例13: IsOutlineVisible_PointF_Pen_Graphics

		public void IsOutlineVisible_PointF_Pen_Graphics()
		{
			path = new GraphicsPath ();
			path.AddRectangle (new RectangleF (10f, 10f, 300f, 300f));
			
			path.StartFigure();
			path.AddRectangle (new RectangleF (150f, 10f, 50f, 400f));

			Pen pen = new Pen (Color.Red, 5);
			Graphics gr = Graphics.FromImage (new Bitmap (512, 512));
			gr.Clip = new Region (new Rectangle ( 5, 5, 500, 50));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (0f, 0f), pen, gr));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (40f, 40f), pen, gr));

			Assert.IsTrue (path.IsOutlineVisible (new PointF (9f, 9f), pen, gr));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (400f, 400f), pen, gr));

			Assert.IsTrue (path.IsOutlineVisible (new PointF (312f, 312f), pen, gr));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (313f, 313f), pen, gr));

			//t.AssertCompare ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:26,代码来源:GraphicsPath.cs

示例14: IsOutlineVisible_PointF_Pen

		public void IsOutlineVisible_PointF_Pen()
		{
			path = new GraphicsPath ();
			path.AddRectangle (new RectangleF (10f, 10f, 300f, 300f));
			
			path.StartFigure();
			path.AddRectangle (new RectangleF (150f, 10f, 50f, 400f));

			Pen pen = new Pen (Color.Red, 5);

			Assert.IsFalse (path.IsOutlineVisible (new PointF (0f, 0f), pen));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (40f, 40f), pen));

			Assert.IsTrue (path.IsOutlineVisible (new PointF (9f, 9f), pen));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (400f, 400f), pen));

			Assert.IsTrue (path.IsOutlineVisible (new PointF (312f, 312f), pen));

			Assert.IsFalse (path.IsOutlineVisible (new PointF (313f, 313f), pen));

			//t.AssertCompare ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:24,代码来源:GraphicsPath.cs

示例15: GetMousePoint

 private MousePoint GetMousePoint(GraphicsPath path, PointF point, Matrix matrix, ToolOperation operation)
 {
     if (operation == ToolOperation.Flip)
     {
         this.currentMousePoint = MousePoint.Flip;
     }
     RectangleF ef1 = PathFunc.GetBounds(path);
     PointF[] tfArray1 = new PointF[9] { new PointF(ef1.X, ef1.Y), new PointF(ef1.X + (ef1.Width / 2f), ef1.Y), new PointF(ef1.Right, ef1.Y), new PointF(ef1.Right, ef1.Y + (ef1.Height / 2f)), new PointF(ef1.Right, ef1.Bottom), new PointF(ef1.X + (ef1.Width / 2f), ef1.Bottom), new PointF(ef1.X, ef1.Bottom), new PointF(ef1.X, ef1.Y + (ef1.Height / 2f)), new PointF(ef1.X + (ef1.Width / 2f), ef1.Y + (ef1.Height / 2f)) } ;
     this.ps = tfArray1;
     matrix.TransformPoints(this.ps);
     //			this.ps = this.ps;
     RectangleF ef2 = new RectangleF(this.ps[0].X - 2f, this.ps[0].Y - 2f, 5f, 5f);
     GraphicsPath path1 = new GraphicsPath();
     path1.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[2].X - 2f, this.ps[2].Y - 2f, 5f, 5f);
     GraphicsPath path2 = new GraphicsPath();
     path2.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[1].X - 2f, this.ps[1].Y - 2f, 5f, 5f);
     GraphicsPath path3 = new GraphicsPath();
     path3.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[7].X - 2f, this.ps[7].Y - 2f, 5f, 5f);
     GraphicsPath path4 = new GraphicsPath();
     path4.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[6].X - 2f, this.ps[6].Y - 2f, 5f, 5f);
     GraphicsPath path5 = new GraphicsPath();
     path5.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[3].X - 2f, this.ps[3].Y - 2f, 5f, 5f);
     GraphicsPath path6 = new GraphicsPath();
     path6.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[5].X - 3f, this.ps[5].Y - 2f, 5f, 5f);
     GraphicsPath path7 = new GraphicsPath();
     path7.AddRectangle(ef2);
     ef2 = new RectangleF(this.ps[4].X - 2f, this.ps[4].Y - 2f, 5f, 5f);
     GraphicsPath path8 = new GraphicsPath();
     path8.AddRectangle(ef2);
     GraphicsPath path9 = new GraphicsPath();
     path9.AddLine(this.ps[0], this.ps[6]);
     GraphicsPath path10 = new GraphicsPath();
     path10.AddLine(this.ps[2], this.ps[4]);
     GraphicsPath path11 = new GraphicsPath();
     path11.AddLine(this.ps[0], this.ps[2]);
     GraphicsPath path12 = new GraphicsPath();
     path12.AddLine(this.ps[6], this.ps[4]);
     GraphicsPath path13 = new GraphicsPath();
     path13.AddRectangle(new RectangleF(this.ps[0].X - 5f, this.ps[0].Y - 5f, 8f, 8f));
     GraphicsPath path14 = new GraphicsPath();
     path14.AddRectangle(new RectangleF(this.ps[2].X - 2f, this.ps[2].Y - 5f, 8f, 8f));
     GraphicsPath path15 = new GraphicsPath();
     path15.AddRectangle(new RectangleF(this.ps[4].X - 3f, this.ps[4].Y - 3f, 8f, 8f));
     GraphicsPath path16 = new GraphicsPath();
     path16.AddRectangle(new RectangleF(this.ps[6].X - 2f, this.ps[6].Y - 5f, 8f, 8f));
     PointF tf1 = this.mouseAreaControl.CenterPoint;
     GraphicsPath path17 = new GraphicsPath();
     if (!tf1.IsEmpty)
     {
         path17.AddEllipse((float) (tf1.X - 3f), (float) (tf1.Y - 3f), (float) 6f, (float) 6f);
     }
     RectangleF ef3 = new RectangleF(point.X - 1f, point.Y - 1f, 2f, 2f);
     GraphicsPath path18 = (GraphicsPath) path.Clone();
     path.Transform(matrix);
     Pen pen1 = new Pen(Color.Blue, 3f);
     pen1.Alignment = PenAlignment.Center;
     MousePoint point1 = MousePoint.None;
     if (OperationFunc.IsSelectOperation(operation))
     {
         ToolOperation operation1 = operation;
         if ((operation1==ToolOperation.Exceptant)||(operation1 == ToolOperation.Select) && (path.IsVisible(point) || path.IsOutlineVisible(point, pen1)))
         {
             return MousePoint.Translate;
         }
     }
     else if (OperationFunc.IsTransformOperation(operation))
     {
         //				if (path17.IsVisible(point) || path17.IsOutlineVisible(point, pen1))
         //				{
         //					point1 = MousePoint.CenterPoint;
         //				}
         //				else
         if (path1.IsVisible(point) || path1.IsOutlineVisible(point, pen1))
         {
             point1 = MousePoint.ScaleTopLeft;
         }
         else if (path3.IsVisible(point) || path3.IsOutlineVisible(point, pen1))
         {
             point1 = MousePoint.ScaleTopMiddle;
         }
         else if (path2.IsVisible(point) || path2.IsOutlineVisible(point, pen1))
         {
             point1 = MousePoint.ScaleTopRight;
         }
         else if (path4.IsVisible(point) || path4.IsOutlineVisible(point, pen1))
         {
             point1 = MousePoint.ScaleMiddleLeft;
         }
         else if (path6.IsVisible(point) || path6.IsOutlineVisible(point, pen1))
         {
             point1 = MousePoint.ScaleMiddleRight;
         }
         else if (path5.IsVisible(point) || path5.IsOutlineVisible(point, pen1))
         {
//.........这里部分代码省略.........
开发者ID:EdgarEDT,项目名称:myitoppsp,代码行数:101,代码来源:SelectOperation.cs


注:本文中的System.Drawing.Drawing2D.GraphicsPath.IsOutlineVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。