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


C# Rectangle.GetRight方法代码示例

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


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

示例1: WarpPerspective

		public WarpPerspective(IEnumerable<PointD> destPoints, Rectangle srcRect)
		{
			if (destPoints == null || destPoints.Count() != 4)
				throw new ArgumentException("destPoints");

			if (srcRect == null)
				throw new ArgumentNullException("srcRect");

			_pntSrc[0].X = _pntSrc[2].X = srcRect.GetLeft();
			_pntSrc[1].X = _pntSrc[3].X = srcRect.GetRight();
			_pntSrc[0].Y = _pntSrc[1].Y = srcRect.GetTop();
			_pntSrc[2].Y = _pntSrc[3].Y = srcRect.GetBottom();

			PreCalc(destPoints.ToArray(), _pntSrc);
		}
开发者ID:pruiz,项目名称:Mono.CairoWarp,代码行数:15,代码来源:WarpPerspective.cs

示例2: AddSurfaceRectangleToHistogram

        protected unsafe override void AddSurfaceRectangleToHistogram(ImageSurface surface, Rectangle rect)
        {
            long[] histogramB = histogram[0];
            long[] histogramG = histogram[1];
            long[] histogramR = histogram[2];

            for (int y = (int)rect.Y; y < rect.GetBottom (); ++y)
            {
                ColorBgra* ptr = surface.GetPointAddressUnchecked((int)rect.X, y);
                for (int x = (int)rect.X; x < rect.GetRight (); ++x)
                {
                    ++histogramB[ptr->B];
                    ++histogramG[ptr->G];
                    ++histogramR[ptr->R];
                    ++ptr;
                }
            }
        }
开发者ID:asbjornu,项目名称:Pinta,代码行数:18,代码来源:HistogramRGB.cs

示例3: CreateRectangleSelection

		/// <summary>
		/// Create a rectangular Selection from a Rectangle.
		/// </summary>
		/// <param name="r">The Rectangle.</param>
		public void CreateRectangleSelection(Rectangle r)
		{
			SelectionPolygons.Clear();
			SelectionPolygons.Add (CreateRectanglePolygon (r));

		    Origin = new PointD (r.X, r.Y);
		    End = new PointD (r.GetRight (), r.GetBottom ());

            MarkDirty ();
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:14,代码来源:DocumentSelection.cs

示例4: Set

 public void Set(Rectangle rect, bool newValue)
 {
     for (int y = (int)rect.Y; y < rect.GetBottom (); ++y)
     {
         for (int x = (int)rect.X; x < rect.GetRight (); ++x)
         {
             Set(x, y, newValue);
         }
     }
 }
开发者ID:deckarep,项目名称:Pinta,代码行数:10,代码来源:BitVector2DSurfaceAdapter.cs

示例5: Invert

 public void Invert(Rectangle rect)
 {
     for (int y = (int)rect.Y; y < rect.GetBottom (); ++y)
     {
         for (int x = (int)rect.X; x < rect.GetRight (); ++x)
         {
             Invert(x, y);
         }
     }
 }
开发者ID:deckarep,项目名称:Pinta,代码行数:10,代码来源:BitVector2DSurfaceAdapter.cs

示例6: PolygonSetFromStencil

        public static unsafe Point[][] PolygonSetFromStencil(IBitVector2D stencil, Rectangle bounds, int translateX, int translateY)
        {
            List<Point[]> polygons = new List<Point[]>();

            if (!stencil.IsEmpty)
            {
                Point start = bounds.Location ();
                List<Point> pts = new List<Point>();
                int count = 0;

                // find all islands
                while (true)
                {
                    bool startFound = false;

                    while (true)
                    {
                        if (stencil[start])
                        {
                            startFound = true;
                            break;
                        }

                        ++start.X;

                        if (start.X >= bounds.GetRight ())
                        {
                            ++start.Y;
                            start.X = (int)bounds.X;

                            if (start.Y >= bounds.GetBottom ())
                            {
                                break;
                            }
                        }
                    }

                    if (!startFound)
                    {
                        break;
                    }

                    pts.Clear();
                    Point last = new Point(start.X, start.Y + 1);
                    Point curr = new Point(start.X, start.Y);
                    Point next = curr;
                    Point left = new Point ();
                    Point right = new Point ();

                    // trace island outline
                    while (true)
                    {
                        left.X = ((curr.X - last.X) + (curr.Y - last.Y) + 2) / 2 + curr.X - 1;
                        left.Y = ((curr.Y - last.Y) - (curr.X - last.X) + 2) / 2 + curr.Y - 1;

                        right.X = ((curr.X - last.X) - (curr.Y - last.Y) + 2) / 2 + curr.X - 1;
                        right.Y = ((curr.Y - last.Y) + (curr.X - last.X) + 2) / 2 + curr.Y - 1;

                        if (bounds.ContainsPoint(left.X, left.Y) && stencil[left])
                        {
                            // go left
                            next.X += curr.Y - last.Y;
                            next.Y -= curr.X - last.X;
                        }
                        else if (bounds.ContainsPoint(right.X, right.Y) && stencil[right])
                        {
                            // go straight
                            next.X += curr.X - last.X;
                            next.Y += curr.Y - last.Y;
                        }
                        else
                        {
                            // turn right
                            next.X -= curr.Y - last.Y;
                            next.Y += curr.X - last.X;
                        }

                        if (Math.Sign(next.X - curr.X) != Math.Sign(curr.X - last.X) ||
                            Math.Sign(next.Y - curr.Y) != Math.Sign(curr.Y - last.Y))
                        {
                            pts.Add(curr);
                            ++count;
                        }

                        last = curr;
                        curr = next;

                        if (next.X == start.X && next.Y == start.Y)
                        {
                            break;
                        }
                    }

                    Point[] points = pts.ToArray();
                    Scanline[] scans = points.GetScans ();

                    foreach (Scanline scan in scans)
                    {
                        stencil.Invert(scan);
                    }
//.........这里部分代码省略.........
开发者ID:joehillen,项目名称:Pinta,代码行数:101,代码来源:PathManager.cs


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