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


C# Context.FillStrokedEllipse方法代码示例

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


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

示例1: DrawShape

        protected override Rectangle DrawShape(Rectangle rect, Layer l)
        {
            Rectangle dirty;

            using (Context g = new Context (l.Surface)) {
                g.AppendPath (PintaCore.Layers.SelectionPath);
                g.FillRule = FillRule.EvenOdd;
                g.Clip ();

                g.Antialias = Antialias.Subpixel;

                dirty = rect;

                if (FillShape && StrokeShape)
                    dirty = g.FillStrokedEllipse (rect, fill_color, outline_color, BrushWidth);
                else if (FillShape)
                    dirty = g.FillEllipse (rect, outline_color);
                else
                    dirty = g.DrawEllipse (rect, outline_color, BrushWidth);
            }

            return dirty;
        }
开发者ID:xxgreg,项目名称:Pinta,代码行数:23,代码来源:EllipseTool.cs

示例2: DrawHoverPoint

		/// <summary>
		/// Draws the hover point, if any.
		/// </summary>
		/// <param name="g"></param>
		protected void DrawHoverPoint(Context g)
		{
			ShapeEngine activeEngine = ActiveShapeEngine;

			if (activeEngine != null)
			{
				last_control_pt_size = Math.Min(activeEngine.BrushWidth + 1, 5);
			}
			else
			{
				last_control_pt_size = Math.Min(BrushWidth + 1, 5);
			}

			double controlPointOffset = (double)last_control_pt_size / 2d;

			//Verify that the user isn't changing the tension of a control point and that there is a hover point to draw.
			if (!changing_tension && hover_point.X > -1d)
			{
				Rectangle hoverOuterEllipseRect = new Rectangle(
					hover_point.X - controlPointOffset * 3d, hover_point.Y - controlPointOffset * 3d,
					controlPointOffset * 6d, controlPointOffset * 6d);

				g.FillStrokedEllipse(hoverOuterEllipseRect, hover_color, hover_color, 1);

				g.FillStrokedEllipse(new Rectangle(
					hover_point.X - controlPointOffset, hover_point.Y - controlPointOffset,
					last_control_pt_size, last_control_pt_size), hover_color, hover_color, (int)last_control_pt_size);


				hoverOuterEllipseRect = hoverOuterEllipseRect.Inflate(1, 1);

				//Since the hover point can be outside of the active shape's bounds (hovering over a different shape), a special
				//invalidation call needs to be made for the hover point in order to ensure its visibility at all times.
				PintaCore.Workspace.Invalidate(hoverOuterEllipseRect.ToGdkRectangle());

				last_hover = hoverOuterEllipseRect;
				last_hover = last_hover.Value.Clamp();
			}
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:43,代码来源:BaseEditEngine.cs

示例3: DrawShape

        protected override Rectangle DrawShape(Rectangle rect, Layer l)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            Rectangle dirty;

            using (Context g = new Context (l.Surface)) {
                g.AppendPath (doc.Selection.SelectionPath);
                g.FillRule = FillRule.EvenOdd;
                g.Clip ();

                g.Antialias = UseAntialiasing ? Antialias.Subpixel : Antialias.None;

                dirty = rect;

                if (FillShape && StrokeShape)
                    dirty = g.FillStrokedEllipse (rect, fill_color, outline_color, BrushWidth);
                else if (FillShape)
                    dirty = g.FillEllipse (rect, outline_color);
                else
                    dirty = g.DrawEllipse (rect, outline_color, BrushWidth);
            }

            return dirty;
        }
开发者ID:JoeyScarr,项目名称:Pinta,代码行数:25,代码来源:EllipseTool.cs

示例4: DrawControlPoints

		protected void DrawControlPoints(Context g, bool drawHoverSelection)
		{
			ShapeEngine activeEngine = ActiveShapeEngine;

			if (activeEngine != null)
			{
				last_control_pt_size = Math.Min(activeEngine.BrushWidth + 1, 3);
			}
			else
			{
				last_control_pt_size = Math.Min(BrushWidth + 1, 3);
			}

			double controlPointOffset = (double)last_control_pt_size / 2d;

			if (activeEngine != null)
			{
				//Draw the control points for the active shape.

				if (drawHoverSelection)
				{
					ControlPoint selPoint = SelectedPoint;

					if (selPoint != null)
					{
						//Draw a ring around the selected point.
						g.FillStrokedEllipse(
							new Rectangle(
								selPoint.Position.X - controlPointOffset * 4d,
								selPoint.Position.Y - controlPointOffset * 4d,
								controlPointOffset * 8d, controlPointOffset * 8d),
							ToolControl.FillColor, ToolControl.StrokeColor, 1);
					}
				}

				List<ControlPoint> controlPoints = activeEngine.ControlPoints;

				//Determine if the shape has one or more points.
				if (controlPoints.Count > 0)
				{
					//Draw the control points for the shape.
					for (int i = 0; i < controlPoints.Count; ++i)
					{
						//Skip drawing the hovered control point.
						if (drawHoverSelection && hovered_pt_as_control_pt > -1 && hover_point.Distance(controlPoints[i].Position) < 1d)
						{
							continue;
						}

						//Draw each control point.
						g.FillStrokedEllipse(
							new Rectangle(
								controlPoints[i].Position.X - controlPointOffset,
								controlPoints[i].Position.Y - controlPointOffset,
								last_control_pt_size, last_control_pt_size),
							ToolControl.FillColor, ToolControl.StrokeColor, (int)last_control_pt_size);
					}
				}

				if (drawHoverSelection)
				{
					//Draw the hover point.
					DrawHoverPoint(g);
				}
			}
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:66,代码来源:BaseEditEngine.cs


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