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


C# Point.ScreenToViewport方法代码示例

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


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

示例1: StartPanning

		protected virtual void StartPanning(MouseButtonEventArgs e)
		{
			panningStartPointInScreen = e.GetPosition(this);
			panningStartPointInViewport = panningStartPointInScreen.ScreenToViewport(Viewport.Transform);

			Plotter2D.UndoProvider.CaptureOldValue(Viewport, Viewport2D.VisibleProperty, Viewport.Visible);

			isPanning = true;
			CaptureMouse();
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:10,代码来源:MouseNavigation.cs

示例2: MouseWheelZoom

		private void MouseWheelZoom(Point mousePos, int wheelRotationDelta)
		{
			Point zoomTo = mousePos.ScreenToViewport(Viewport.Transform);

			double zoomSpeed = Math.Abs(wheelRotationDelta / Mouse.MouseWheelDeltaForOneLine);
			zoomSpeed *= wheelZoomSpeed;
			if (wheelRotationDelta < 0)
			{
				zoomSpeed = 1 / zoomSpeed;
			}
			Viewport.Visible = Viewport.Visible.Zoom(zoomTo, zoomSpeed);
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:12,代码来源:MouseNavigation.cs

示例3: UpdateLittleVisible

		private void UpdateLittleVisible(Point pos)
		{
			Size littleSize = new Size(Plotter2D.Viewport.Visible.Width / zoomCoeff * ActualWidth / Plotter2D.Viewport.Output.Width,
									   Plotter2D.Viewport.Visible.Height / zoomCoeff * ActualHeight / Plotter2D.Viewport.Output.Height);
			Rect littleVisible = RectExtensions.FromCenterSize(pos.ScreenToViewport(Plotter2D.Viewport.Transform), littleSize);
			littlePlotter.Viewport.Visible = littleVisible;
		}
开发者ID:elsiete,项目名称:DynamicDataDisplay,代码行数:7,代码来源:MapMagnifyingGlass.cs

示例4: CentralGrid_MouseLeftButtonUp

 void CentralGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (isCtrlPressed) {
         Plotter.MainCanvas.Children.Remove(zoomingRect);
         Point currPosution = e.GetPosition(Plotter.CentralGrid);
         Point p1 = zoomingRectStartPointInScreen.ScreenToViewport(Viewport.Transform);
         Point p2 = new Point();
         if (currPosution.X < zoomingRectStartPointInScreen.X)
             p2.X = zoomingRectStartPointInScreen.X - zoomingRect.Width;
         else
             p2.X = currPosution.X;
         if (currPosution.Y < zoomingRectStartPointInScreen.Y)
             p2.Y = zoomingRectStartPointInScreen.Y - zoomingRect.Height;
         else
             p2.Y = currPosution.Y;
         p2 = p2.ScreenToViewport(Viewport.Transform);
         Rect newVisible = new Rect(p1, p2);
         Viewport.Visible = newVisible;
     }
     else
     if (isPanning)
     {
         //Point panningEndPointInScreen;
         //panningEndPointInScreen = e.GetPosition(Plotter.CentralGrid);
         //panningEndPointInViewport = panningEndPointInScreen.ScreenToViewport(Viewport.Transform);
         //relocateVisisble();
         isPanning = false;
     }
 }
开发者ID:modulexcite,项目名称:DynamicDataDisplay,代码行数:29,代码来源:MouseNavigation.cs

示例5: OnMouseLeftButtonDown

		protected virtual void OnMouseLeftButtonDown(MouseButtonEventArgs e)
		{
			lmbInitialPosition = e.GetPosition(listeningPanel);

			var foundActivePlotter = UpdateActivePlotter(e);
			if (foundActivePlotter)
			{
				lmbPressed = true;
				dragStartInViewport = lmbInitialPosition.ScreenToViewport(activePlotter.Transform);

				listeningPanel.Background = fillBrush;
				listeningPanel.CaptureMouse();

				e.Handled = true;
			}
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:16,代码来源:AxisNavigation.cs

示例6: StartPanning

		protected virtual void StartPanning(MouseButtonEventArgs e)
		{
			panningStartPointInScreen = e.GetPosition(this);
			panningStartPointInViewport = panningStartPointInScreen.ScreenToViewport(Viewport.Transform);

			Plotter2D.UndoProvider.CaptureOldValue(Viewport, Viewport2D.VisibleProperty, Viewport.Visible);

			isPanning = true;

			// not capturing mouse because this made some tools like PointSelector not
			// receive MouseUp events on markers;
			// Mouse will be captured later, in the first MouseMove handler call.
			// CaptureMouse();

			Viewport.PanningState = Viewport2DPanningState.Panning;

			//e.Handled = true;
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:18,代码来源:MouseNavigation.cs

示例7: OnMouseLeftButtonDown

		protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
		{
			base.OnMouseLeftButtonDown(e);

			lmbInitialPosition = e.GetPosition(this);

			dragStart = lmbInitialPosition.ScreenToViewport(Transform);
			lmbPressed = true;

			content.Background = fillBrush;

			CaptureMouse();
		}
开发者ID:XiBeichuan,项目名称:hydronumerics,代码行数:13,代码来源:OldAxisNavigation.cs


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