• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Drawing.PointF类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



System.Drawing.PointF类属于命名空间,在下文中一共展示了System.Drawing.PointF类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetRelativePosition

	    public System.Drawing.PointF GetRelativePosition(Control c) {
	    	System.Drawing.Point relPoint;
	    	System.Drawing.PointF relPointF;
	    	relPoint = c.PointToClient(new System.Drawing.Point((int)ScreenX,(int)ScreenY));
	    	relPointF = new System.Drawing.PointF(relPoint.X + ScreenX - (float)((int)ScreenX),
	    	                                      relPoint.Y + ScreenY - (float)((int)ScreenY));
	    	return relPointF;
	    }
开发者ID:sanyaade-g2g-repos,项目名称:knack,代码行数:8,代码来源:TabletForm.cs


示例2: PointF

 public PointF(float x, float y)
 {
     InternalVector2 = new Vector2(x, y);
     InternalPointF = new System.Drawing.PointF(x, y);
     X = x;
     Y = y;
 }
开发者ID:treytomes,项目名称:DirectCanvas,代码行数:7,代码来源:PointF.cs


示例3: VirtualProjector

        public VirtualProjector(string name, string uuid, Size imageSize, PointF principal, double focalLength, Screen screen, Chessboard chessboard, CaptureCamera captureCamera)
            : base(name, uuid, imageSize, principal, focalLength, screen, chessboard, captureCamera)
        {
            OrbitCamera = new OrbitCamera("{0} Orbit".FormatWith(name), "N/A", imageSize, principal, focalLength,
                Intrinsics.NearPlaneDistance, Intrinsics.FarPlaneDistance) { Color = Color.DarkCyan.Alpha(0.7f), };
            Color = Color.DarkKhaki.Alpha(0.6f);
            
            ProgramTask.AttachInputToCamera(Program.WhenInput.Where(input => !input.KeyPressed(Keys.C)), Window, OrbitCamera);

            Program.WhenInput.Where(input => input.KeyDown(Keys.P)).Subscribe(input =>
            {
                var frustum = new Frustum(OrbitCamera, Intrinsics.ImageSize);

                var plane = new Plane(Vector3.UnitZ, 0);

                var p0 = frustum.IntersectWithPlane(ProjectorQuadCorners[0].X, ProjectorQuadCorners[0].Y, plane).ToPointF();
                var p1 = frustum.IntersectWithPlane(ProjectorQuadCorners[1].X, ProjectorQuadCorners[1].Y, plane).ToPointF();
                var p2 = frustum.IntersectWithPlane(ProjectorQuadCorners[2].X, ProjectorQuadCorners[2].Y, plane).ToPointF();
                var p3 = frustum.IntersectWithPlane(ProjectorQuadCorners[3].X, ProjectorQuadCorners[3].Y, plane).ToPointF();

                var quadCorners = new[] { p0, p1, p2, p3, };

                // Chessboard.HomographTo(quadCorners);
            });
        }
开发者ID:JaapSuter,项目名称:Pentacorn,代码行数:25,代码来源:VirtualProjector.cs


示例4: ComputeDepthFrameToCameraSpaceTable

        public System.Drawing.PointF[] ComputeDepthFrameToCameraSpaceTable(int tableWidth = depthImageWidth, int tableHeight = depthImageHeight)
        {
            float fx = (float)depthCameraMatrix[0, 0];
            float fy = (float)depthCameraMatrix[1, 1];
            float cx = (float)depthCameraMatrix[0, 2];
            float cy = (float)depthCameraMatrix[1, 2];
            float[] kappa = new float[] { (float)depthLensDistortion[0], (float)depthLensDistortion[1] };

            var table = new System.Drawing.PointF[tableWidth * tableHeight];

            for (int y = 0; y < tableHeight; y++)
                for (int x = 0; x < tableWidth; x++)
                {
                    double xout, yout;
                    double framex = (double)x / (double)tableWidth * depthImageWidth;   // in depth camera image coordinates
                    double framey = (double)y / (double)tableHeight * depthImageHeight;

                    CameraMath.Undistort(fx, fy, cx, cy, kappa, framex, (depthImageHeight - framey), out xout, out yout);

                    var point = new System.Drawing.PointF();
                    point.X = (float)xout;
                    point.Y = (float)yout;
                    table[tableWidth * y + x] = point;
                }
            return table;
        }
开发者ID:karthikbadam,项目名称:RoomAliveToolkit,代码行数:26,代码来源:Kinect2Calibration.cs


示例5: RenderArrow

 /// <summary>
 /// Method to render the arrow
 /// </summary>
 /// <param name="map">The map</param>
 /// <param name="graphics">The graphics object</param>
 /// <param name="arrow">The arrow</param>
 private void RenderArrow(SharpMap.Map map, System.Drawing.Graphics graphics, GeoAPI.Geometries.ILineString arrow)
 {
     var pts = new System.Drawing.PointF[arrow.Coordinates.Length];
     for (var i = 0; i < pts.Length; i++)
         pts[i] = map.WorldToImage(arrow.GetCoordinateN(i));
     graphics.DrawLines(ArrowPen, pts);
 }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:13,代码来源:LineSymbolizerTest.cs


示例6: Draw

 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - Width / 2), (float)(Center.Y - Height / 2));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)Width, (float)Height);
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillRectangle(solidBrush, rect);
     solidBrush.Dispose();
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:9,代码来源:Rectangle.cs


示例7: Draw

 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF upperLeftPoint = new System.Drawing.PointF((float)(Center.X - RadiusX), (float)(Center.Y - RadiusY));
     System.Drawing.SizeF rectSize = new System.Drawing.SizeF((float)(2 * RadiusX), (float)(2 * RadiusY));
     System.Drawing.RectangleF rect = new System.Drawing.RectangleF(upperLeftPoint, rectSize);
     g.FillEllipse(solidBrush, rect);
     solidBrush.Dispose();
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:9,代码来源:Ellipse.cs


示例8: PopulateRotationCorrectedTranslationIncrements

		private void PopulateRotationCorrectedTranslationIncrements(Angle headingChange)
		{
			double s = Math.Sin(headingChange.Rads);
			double c = Math.Cos(headingChange.Rads);

			m_TranslationIncrements.Clear();
			System.Drawing.PointF[] featurePointPair = new System.Drawing.PointF[2];

			List<TrackedFeature> trackedFeatures = m_VisualOdometer.TrackedFeatures;
			m_GroundFeatures.Clear();
			for (int i = 0; i < trackedFeatures.Count; i++)
			{
				TrackedFeature trackedFeature = trackedFeatures[i];
				if (trackedFeature.Count < 2)
				{
					continue;
				}

				// previous and current feature points need to be in the ground region
				if (!(trackedFeature[-1].Y > m_VisualOdometer.GroundRegionTop && trackedFeature[0].Y > m_VisualOdometer.GroundRegionTop))
				{
					continue;
				}

				featurePointPair[0] = trackedFeature[-1]; // previous feature location
				featurePointPair[1] = trackedFeature[0];  // current featue location
				//Debug.WriteLine("Raw:");
				//Debug.WriteLine("\tPrevious dx_r: {0:0.000}  dy_r: {1:0.000}", featurePointPair[0].X, featurePointPair[0].Y);
				//Debug.WriteLine("\tCurrent  dx_r: {0:0.000}  dy_r: {1:0.000}", featurePointPair[1].X, featurePointPair[1].Y);

				ProjectOnFloor(featurePointPair);
				//Debug.WriteLine("Ground:");
				//Debug.WriteLine("\tPrevious dx_r: {0:0.000}  dy_r: {1:0.000}", featurePointPair[0].X, featurePointPair[0].Y);
				//Debug.WriteLine("\tCurrent  dx_r: {0:0.000}  dy_r: {1:0.000}", featurePointPair[1].X, featurePointPair[1].Y);


				// Remove rotation effect on current feature location. The center of the rotation is the previous feature location
				Point rotationCorrectedEndPoint = new Point(
					c * featurePointPair[1].X - s * featurePointPair[1].Y,
					s * featurePointPair[1].X + c * featurePointPair[1].Y);

				Point translationIncrement = new Point(
					featurePointPair[0].X - rotationCorrectedEndPoint.X,
					featurePointPair[0].Y - rotationCorrectedEndPoint.Y);

				//double translationAngle = Math.Abs(Math.Atan2(translationIncrement.X, translationIncrement.Y));
				////Debug.WriteLine(translationAngle * 180 / Math.PI);
				//if (translationAngle > acceptedDirectionMisaligment)
				//{
				//    continue;
				//}

				//m_UsedGroundFeatures.Add(trackedFeature);
				m_TranslationIncrements.Add(translationIncrement);
				m_GroundFeatures.Add(trackedFeature);
			}
		}
开发者ID:Tymolc,项目名称:drh-visual-odometry,代码行数:57,代码来源:TranslationAnalyzer.cs


示例9: ToPointFArray

 public static System.Drawing.PointF[] ToPointFArray(DataP3[] data)
 {
     int n = data.Length;
     System.Drawing.PointF[] newData = new System.Drawing.PointF[n];
     for (int i = 0; i < n; i++)
     {
         newData[i] = new System.Drawing.PointF((float)data[i].X, (float)data[i].Y);
     }
     return newData;
 }
开发者ID:OlgaRabodzei,项目名称:NetForMap_CSharp,代码行数:10,代码来源:DataP3.cs


示例10: TestDashedLineStartEnd

 public void TestDashedLineStartEnd()
 {
     System.Drawing.PointF start = new System.Drawing.PointF();
     System.Drawing.PointF end = new System.Drawing.PointF();
     string expectedString = null;
     string resultString = null;
     resultString = SVGUtil.DashedLine(start, end);
     Assert.AreEqual(expectedString, resultString, "DashedLine method returned unexpected result.");
     Assert.Fail("Create or modify test(s).");
 }
开发者ID:ecell,项目名称:ecell3-ide,代码行数:10,代码来源:TestSVGUtil.cs


示例11: LabelStyle

 /// <summary>
 /// Initializes a new LabelStyle
 /// </summary>
 public LabelStyle()
 {
     _Font = new System.Drawing.Font("Times New Roman", 12f);
     _Offset = new System.Drawing.PointF(0, 0);
     _CollisionDetection = false;
     _CollisionBuffer = new System.Drawing.Size(0, 0);
     _ForeColor = System.Drawing.Color.Black;
     _HorisontalAlignment = HorizontalAlignmentEnum.Center;
     _VerticalAlignment = VerticalAlignmentEnum.Middle;
 }
开发者ID:stophun,项目名称:fdotoolbox,代码行数:13,代码来源:LabelStyle.cs


示例12: Draw

 public override void Draw(System.Drawing.Graphics g)
 {
     System.Drawing.SolidBrush solidBrush = new System.Drawing.SolidBrush(Color);
     System.Drawing.PointF[] points = new System.Drawing.PointF[3];
     points[0] = new System.Drawing.PointF((float)Vertex1.X, (float)Vertex1.Y);
     points[1] = new System.Drawing.PointF((float)Vertex2.X, (float)Vertex2.Y);
     points[2] = new System.Drawing.PointF((float)Vertex3.X, (float)Vertex3.Y);
     g.FillPolygon(solidBrush, points);
     solidBrush.Dispose();
 }
开发者ID:abdonkov,项目名称:HackBulgaria-CSharp,代码行数:10,代码来源:Triangle.cs


示例13: RealProjector

        public RealProjector(string name, string uuid, Size imageSize, PointF principal, double focalLength, Screen screen)
            : base(name, uuid, imageSize, principal, focalLength)
        {
            Window = new Window("Pentacorn Projector")
            {
                LocatedOnScreen = screen,
                FullScreen = true,
            };

            Color = Color.DarkBlue;
            Window.Scene = new Scene(new ScreenCamera(Window)) { new Clear(Color.White), };
        }
开发者ID:JaapSuter,项目名称:Pentacorn,代码行数:12,代码来源:RealProjector.cs


示例14: InvoiceTableView

 public InvoiceTableView()
     : base(MonoTouch.UIKit.UITableViewStyle.Plain)
 {
     CellIdentifier = InvoiceLineCell.Key;
     SectionHeaderHeight = 30;
     RowHeight = 60;
     ContentOffset = new System.Drawing.PointF (0, -100);
     BackgroundView = null;
     BackgroundColor = UIColor.Clear;
     AutoScroll = true;
     this.ItemTapped = (i) => {
         (i as InvoiceLine).ToggleSelected();
     };
 }
开发者ID:nagyist,项目名称:iPadPos,代码行数:14,代码来源:InvoiceTableView.cs


示例15: Init

        public static void Init(TestContext context)
        {
            dp1 = new System.Drawing.Point(10, 10);
            dp2 = new System.Drawing.Point(100, 100);
            drect = new System.Drawing.Rectangle(5, 5, 15, 15);

            wp1 = new System.Windows.Point(10, 10);
            wp2 = new System.Windows.Point(100, 100);
            wrect = new System.Windows.Rect(5, 5, 15, 15);

            fp1 = new System.Drawing.PointF(10, 10);
            fp2 = new System.Drawing.PointF(100, 100);
            frect = new System.Drawing.RectangleF(5, 5, 15, 15);
        }
开发者ID:CHiiLD,项目名称:net-toolkit,代码行数:14,代码来源:PointTest.cs


示例16: Start

        public override void Start()
        {
            time = 20;
            win = 10;
            startingTime = 3;

            state = State.Starting;

            x = 0;
            y = 0;

            recPos = new System.Drawing.PointF(50, 50);

            timer.Start();
        }
开发者ID:wichtounet,项目名称:MarathonMillions,代码行数:15,代码来源:ClickMe.cs


示例17: FindTriangleAt

        private ITriangle FindTriangleAt(float x, float y)
        {
            // Get mesh coordinates
            var p = new System.Drawing.PointF(x, y);
            renderControl.Zoom.ScreenToWorld(ref p);

            topoControlView.SetPosition(p);

            if (tree == null)
            {
                tree = new TriangleQuadTree(mesh, 5, 2);
            }

            return tree.Query(p.X, p.Y);
        }
开发者ID:cmberryau,项目名称:Triangle.NET-3.5,代码行数:15,代码来源:FormTopology.cs


示例18: PolygonShape2D

        //public PolygonShape2D(string containerName, List<Point> points)
        //{
        //    this.ContainerName = containerName;
        //    this.Points = points;
        //}
        public PolygonShape2D(string containerName, Shape sh, Matrix m)
        {
            this.ContainerName = containerName;
            List<IShapeData> sd = sh.ShapeData;
            EnsureClockwise(sd);

            System.Drawing.PointF[] pts = new System.Drawing.PointF[ sd.Count];
            for (int i = 0; i < sd.Count; i++)
            {
                pts[i] = new System.Drawing.PointF(sd[i].StartPoint.X, sd[i].StartPoint.Y);
            }
            System.Drawing.Drawing2D.Matrix m2 = m.GetDrawing2DMatrix();
            m2.TransformPoints(pts);
            for (int i = 0; i < pts.Length; i++)
            {
                Points.Add(new Point(pts[i].X, pts[i].Y));
            }
        }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:23,代码来源:PolygonShape2D.cs


示例19: IsPointInside

 public virtual bool IsPointInside(Point p)
 {
     bool result = false;
     System.Drawing.Drawing2D.Matrix m = this.Transforms[0].Matrix.GetDrawing2DMatrix();
     m.Invert();
     System.Drawing.PointF[] p2 = new System.Drawing.PointF[] { new System.Drawing.PointF(p.X, p.Y) };
     m.TransformPoints(p2);
     Point tp = new Point(p2[0].X, p2[0].Y);
     for (int i = 0; i < this.Definition.Shapes.Count; i++)
     {
         if (this.Definition.Shapes[i].IsPointInside(tp))
         {
             result = true;
             break;
         }
     }
     return result;
 }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:18,代码来源:Instance2D.cs


示例20: PyrLK

      /// <summary>
      /// Calculates optical flow for a sparse feature set using iterative Lucas-Kanade method in pyramids
      /// </summary>
      /// <param name="prev">First frame, at time t</param>
      /// <param name="curr">Second frame, at time t + dt </param>
      /// <param name="prevPyrBuffer">Buffer for the pyramid for the first frame. If it is not NULL, the buffer must have a sufficient size to store the pyramid from level 1 to level #level ; the total size of (image_width+8)*image_height/3 bytes is sufficient</param>
      /// <param name="currPyrBuffer">Similar to prev_pyr, used for the second frame</param>
      /// <param name="prevFeatures">Array of points for which the flow needs to be found</param>
      /// <param name="winSize">Size of the search window of each pyramid level</param>
      /// <param name="level">Maximal pyramid level number. If 0 , pyramids are not used (single level), if 1 , two levels are used, etc</param>
      /// <param name="criteria">Specifies when the iteration process of finding the flow for each point on each pyramid level should be stopped</param>
      /// <param name="flags">Flags</param>
      /// <param name="currFeatures">Array of 2D points containing calculated new positions of input features in the second image</param>
      /// <param name="status">Array. Every element of the array is set to 1 if the flow for the corresponding feature has been found, 0 otherwise</param>
      /// <param name="trackError">Array of double numbers containing difference between patches around the original and moved points</param>
      public static void PyrLK(
         Image<Gray, Byte> prev,
         Image<Gray, Byte> curr,
         Image<Gray, Byte> prevPyrBuffer,
         Image<Gray, Byte> currPyrBuffer,
         System.Drawing.PointF[] prevFeatures,
         System.Drawing.Size winSize,
         int level,
         MCvTermCriteria criteria,
         Emgu.CV.CvEnum.LKFLOW_TYPE flags,
         out System.Drawing.PointF[] currFeatures,
         out Byte[] status,
         out float[] trackError)
      {
         if (prevPyrBuffer == null)
         {
            prevPyrBuffer = new Image<Gray, byte>(prev.Width + 8, prev.Height / 3);
         }
         if (currPyrBuffer == null)
         {
            currPyrBuffer = prevPyrBuffer.CopyBlank();
         }

         status = new Byte[prevFeatures.Length];
         trackError = new float[prevFeatures.Length];

         currFeatures = new System.Drawing.PointF[prevFeatures.Length];

         CvInvoke.cvCalcOpticalFlowPyrLK(
            prev,
            curr,
            prevPyrBuffer,
            currPyrBuffer,
            prevFeatures,
            currFeatures,
            prevFeatures.Length,
            winSize,
            level,
            status,
            trackError,
            criteria,
            flags);
      }
开发者ID:AnthonyNystrom,项目名称:Pikling,代码行数:58,代码来源:OpticalFlow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Printing.PrintDocument类代码示例发布时间:2022-05-24
下一篇:
C# Drawing.Point类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap