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


C# Media.Transform类代码示例

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


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

示例1: TransformedBitmap

        /// <summary>
        /// Construct a TransformedBitmap with the given newTransform
        /// </summary>
        /// <param name="source">BitmapSource to apply to the newTransform to</param>
        /// <param name="newTransform">Transform to apply to the bitmap</param>
        public TransformedBitmap(BitmapSource source, Transform newTransform)
            : base(true) // Use base class virtuals
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (newTransform == null)
            {
                throw new InvalidOperationException(SR.Get(SRID.Image_NoArgument, "Transform"));
            }

            if (!CheckTransform(newTransform))
            {
                throw new InvalidOperationException(SR.Get(SRID.Image_OnlyOrthogonal));
            }

            _bitmapInit.BeginInit();

            Source = source;
            Transform = newTransform;

            _bitmapInit.EndInit();
            FinalizeCreation();
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:31,代码来源:TransformedBitmap.cs

示例2: EllipseGeometry

		public EllipseGeometry (Point center, double radiusX, double radiusY, Transform transform)
		{
			Transform = transform;
			Center = center;
			RadiusX = radiusX;
			RadiusY = radiusY;
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:7,代码来源:EllipseGeometry.cs

示例3: OnMouseMove

        protected override void OnMouseMove(MouseEventArgs e)
        {
            Window wnd = Window.GetWindow(this);
            Point currentLocation = e.MouseDevice.GetPosition(wnd);

            var move = new TranslateTransform(
                currentLocation.X - _previousLocation.X, currentLocation.Y - _previousLocation.Y);

            if (e.LeftButton == MouseButtonState.Pressed)
            {
                var group = new TransformGroup();
                if (_previousTransform != null)
                {
                    group.Children.Add(_previousTransform);
                }
                group.Children.Add(move);

                RenderTransform = group;
            }
            else
            {
                Cursor = Cursors.Hand;
            }

            _previousLocation = currentLocation;
            _previousTransform = RenderTransform;

            MainWindow.Instance.CalculatePositions();
            base.OnMouseMove(e);
        }
开发者ID:taesiri,项目名称:electric-field,代码行数:30,代码来源:NegativeCharge.xaml.cs

示例4: LineGeometry

 /// <summary>
 /// 
 /// </summary>
 public LineGeometry(
     Point startPoint,
     Point endPoint,
     Transform transform) : this(startPoint, endPoint)
 {
     Transform = transform;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:LineGeometry.cs

示例5: AdornerChartMarkers

 public AdornerChartMarkers(UIElement adornedElement, Transform shapeTransform, IList<ChartMarkerSet> markerSets, XYLineChart parentChart) : base(adornedElement)
 {
     _adornedElement = adornedElement;
     _parentChart = parentChart;
     _markerSets = markerSets;
     _transform = shapeTransform;
 }
开发者ID:idaohang,项目名称:Helicopter-Autopilot-Simulator,代码行数:7,代码来源:AdornerChartMarkers.cs

示例6: GetTransformedFigureCollection

        internal override PathFigureCollection GetTransformedFigureCollection(Transform transform)
        {
            // Combine the transform argument with the internal transform
            Transform combined = new MatrixTransform(GetCombinedMatrix(transform));

            PathFigureCollection result = new PathFigureCollection();
            GeometryCollection children = Children;

            if (children != null)
            {
                for (int i = 0; i < children.Count; i++)
                {
                    PathFigureCollection pathFigures = children.Internal_GetItem(i).GetTransformedFigureCollection(combined);
                    if (pathFigures != null)
                    {
                        int count = pathFigures.Count;
                        for (int j = 0; j < count; ++j)
                        {
                            result.Add(pathFigures[j]);
                        }
                    }
                }
            }

            return result;
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:26,代码来源:GeometryGroup.cs

示例7: RectangleGeometry

		public RectangleGeometry (Rect rect, double radiusX, double radiusY, Transform transform)
		{
			Transform = transform;
			Rect = rect;
			RadiusX = radiusX;
			RadiusY = radiusY;
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:7,代码来源:RectangleGeometry.cs

示例8: EllipseGeometry

 /// <summary>
 /// Constructor - sets the ellipse to the parameters 
 /// </summary>
 public EllipseGeometry(
     Point center,
     double radiusX, 
     double radiusY,
     Transform transform) : this(center, radiusX, radiusY) 
 { 
     Transform = transform;
 } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:11,代码来源:EllipseGeometry.cs

示例9: RectangleGeometry

 /// <summary>
 /// 
 /// </summary>
 /// <param name="rect"></param>
 /// <param name="radiusX"></param>
 /// <param name="radiusY"></param>
 /// <param name="transform"></param>
 public RectangleGeometry(
     Rect rect,
     double radiusX,
     double radiusY,
     Transform transform) : this(rect, radiusX, radiusY)
 {
     Transform = transform;
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:15,代码来源:RectangleGeometry.cs

示例10: GetTransformedGeometries

 public static IEnumerable<Geometry> GetTransformedGeometries(IEnumerable<SqlGeometry> collection, Transform transform)
 {
     foreach (var item in collection)
     {
         Geometry wpf = item.ToWpfGeometry();
         wpf.Transform = transform;
          
         yield return wpf;
     }
 }
开发者ID:HackatonArGP,项目名称:Guardianes,代码行数:10,代码来源:Gateway.cs

示例11: LayoutTransformerScenario

 /// <summary>
 /// Initializes a new instance of the LayoutTransformerScenario class.
 /// </summary>
 /// <param name="preferredWidth">Preferred width of the test control.</param>
 /// <param name="preferredHeight">Preferred height of the test control.</param>
 /// <param name="measureAtPreferredSize">Whether the child control should force its preferred size during Measure.</param>
 /// <param name="arrangeAtPreferredSize">Whether the child control should force its preferred size during Arrange.</param>
 /// <param name="measureWidth">Width to pass to Measure.</param>
 /// <param name="measureHeight">Height to pass to Measure.</param>
 /// <param name="desiredWidth">Expected DesiredSize.Width.</param>
 /// <param name="desiredHeight">Expected DesiredSize.Height.</param>
 /// <param name="arrangeWidth">Width to pass to Arrange.</param>
 /// <param name="arrangeHeight">Height to pass to Arrange.</param>
 /// <param name="renderWidth">Expected RenderSize.Width.</param>
 /// <param name="renderHeight">Expected RenderSize.Height.</param>
 /// <param name="transform">Transform to use.</param>
 public LayoutTransformerScenario(double preferredWidth, double preferredHeight, bool measureAtPreferredSize, bool arrangeAtPreferredSize, double measureWidth, double measureHeight, double desiredWidth, double desiredHeight, double arrangeWidth, double arrangeHeight, double renderWidth, double renderHeight, Transform transform)
 {
     PreferredSize = new Size(preferredWidth, preferredHeight);
     _measureAtPreferredSize = measureAtPreferredSize;
     _arrangeAtPreferredSize = arrangeAtPreferredSize;
     MeasureSize = new Size(measureWidth, measureHeight);
     DesiredSize = new Size(desiredWidth, desiredHeight);
     ArrangeSize = new Size(arrangeWidth, arrangeHeight);
     RenderSize = new Size(renderWidth, renderHeight);
     Transform = transform;
 }
开发者ID:shijiaxing,项目名称:SilverlightToolkit,代码行数:27,代码来源:LayoutTransformerScenario.cs

示例12: RenderUnfilledElements

 public void RenderUnfilledElements(DrawingContext ctx, Rect chartArea, Transform transform) {
   CalculateGeometry(chartArea);
   if(LineColor != Colors.Transparent && LineThickness > 0) {
     Pen pen = new Pen(new SolidColorBrush(LineColor), LineThickness);
     pen.LineJoin = PenLineJoin.Bevel;
     if(IsDashed) {
       pen.DashStyle = new DashStyle(new double[] { 2, 2 }, 0);
     }
     _unfilledGeometry.Transform = transform;
     ctx.DrawGeometry(null, pen, _unfilledGeometry);
   }
 }
开发者ID:jrc60752,项目名称:iRacingAdminSync,代码行数:12,代码来源:ChartPrimitiveEventLine.cs

示例13: StartAnimation

        public static void StartAnimation (Transform animatableElement, DependencyProperty dependencyProperty, double toValue, double durationMilliseconds, double accelerationRatio, double decelerationRatio)
        {
            DoubleAnimation animation = new DoubleAnimation();
            animation.To = toValue;
            animation.AccelerationRatio = accelerationRatio;
            animation.DecelerationRatio = decelerationRatio;
            animation.FillBehavior = FillBehavior.HoldEnd;
            animation.Duration = TimeSpan.FromMilliseconds(durationMilliseconds);
            animation.Freeze();

            animatableElement.BeginAnimation(dependencyProperty, animation, HandoffBehavior.Compose);
        }
开发者ID:BdGL3,项目名称:CXPortal,代码行数:12,代码来源:AnimationHelper.cs

示例14: DoubleAnimator

 /// <summary>
 /// Initializes a new instance of the <see cref="DoubleAnimator"/> class.
 /// </summary>
 /// <param name="translateTransform">The translate transform.</param>
 /// <param name="property">The property.</param>
 public DoubleAnimator(Transform transform, string property)
 {
     this.transform = transform;
     this.storyboard.Completed += this.OnCompleted;
     this.storyboard.Children.Add(this.animation);
     Storyboard.SetTarget(this.animation, this.transform);
     #if WINDOWS_PHONE
     Storyboard.SetTargetProperty(this.animation, new PropertyPath(property));
     #else
     Storyboard.SetTargetProperty(this.animation, property);
     #endif
 }
开发者ID:jlaanstra,项目名称:ReactiveApp,代码行数:17,代码来源:Animator.cs

示例15: RenderUnfilledElements

    public void RenderUnfilledElements(DrawingContext ctx, Rect chartArea, Transform transform) {

      for(int segmentIndex = 0; segmentIndex < _lineColors.Count; ++segmentIndex) {
        SolidColorBrush brush = new SolidColorBrush(_lineColors[segmentIndex]);
        Pen pen = new Pen(brush, LineThickness);
        pen.LineJoin = PenLineJoin.Bevel;
        if(IsDashed) {
          pen.DashStyle = new DashStyle(new double[] { 2, 2 }, 0);
        }
        ctx.DrawLine(pen, transform.Transform(Points[segmentIndex*2]), transform.Transform(Points[segmentIndex*2+1]));
      }
    }
开发者ID:jrc60752,项目名称:iRacingAdminSync,代码行数:12,代码来源:ChartPrimitiveLineSegments.cs


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