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


C# CombineMode类代码示例

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


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

示例1: OnMouseDown

		protected override void OnMouseDown (DrawingArea canvas, ButtonPressEventArgs args, Cairo.PointD point)
		{
			// Ignore extra button clicks while drawing
			if (is_drawing)
				return;

			Document doc = PintaCore.Workspace.ActiveDocument;
			hist = new SelectionHistoryItem(Icon, Name);
			hist.TakeSnapshot();

			reset_origin = args.Event.GetPoint();

            active_control = HandleResize (point);
			if (!active_control.HasValue)
			{
				combine_mode = PintaCore.Workspace.SelectionHandler.DetermineCombineMode(args);

				double x = Utility.Clamp(point.X, 0, doc.ImageSize.Width - 1);
				double y = Utility.Clamp(point.Y, 0, doc.ImageSize.Height - 1);
				shape_origin = new PointD(x, y);

                doc.PreviousSelection.Dispose ();
				doc.PreviousSelection = doc.Selection.Clone();
				doc.Selection.SelectionPolygons.Clear();

                // The bottom right corner should be selected.
                active_control = 3;
			}

            is_drawing = true;
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:31,代码来源:SelectTool.cs

示例2: BuildToolbar

        public void BuildToolbar (Gtk.Toolbar tb)
        {
            if (selection_label == null)
                selection_label = new ToolBarLabel (Catalog.GetString (" Selection Mode: "));

            tb.AppendItem (selection_label);

            if (selection_combo_box == null)
            {
                selection_combo_box = new ToolBarComboBox (170, 0, false);

                selection_combo_box.ComboBox.Changed += (o, e) =>
                {
                    Gtk.TreeIter iter;
                    if (selection_combo_box.ComboBox.GetActiveIter (out iter))
                        selected_mode = (CombineMode)selection_combo_box.Model.GetValue (iter, 1);
                };

                foreach (var mode in combine_modes)
                    selection_combo_box.Model.AppendValues (mode.Value, mode.Key);

                selection_combo_box.ComboBox.Active = 0;
            }

            tb.AppendItem (selection_combo_box);
        }
开发者ID:msiyer,项目名称:Pinta,代码行数:26,代码来源:SelectionModeHandler.cs

示例3: OnMouseDown

		protected override void OnMouseDown(Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
		{
			Document doc = PintaCore.Workspace.ActiveDocument;
            combine_mode = PintaCore.Workspace.SelectionHandler.DetermineCombineMode (args);

			base.OnMouseDown(canvas, args, point);
			doc.ShowSelection = true;
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:8,代码来源:MagicWandTool.cs

示例4: SetClipRect

 public override void SetClipRect(Rectangle rect, CombineMode combineMode = CombineMode.Replace)
 {
     throw new NotSupportedException();
     //gx.SetClip(
     //  this.currentClipRect = new System.Drawing.Rectangle(
     //        rect.X, rect.Y,
     //        rect.Width, rect.Height),
     //        (System.Drawing.Drawing2D.CombineMode)combineMode);
 }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:9,代码来源:2_MyGLCanvas_CoordinateAndClip.cs

示例5: SetClipRect

        /// <summary>
        /// Sets the clipping region of this <see cref="T:System.Drawing.Graphics"/> to the result of the specified operation combining the current clip region and the rectangle specified by a <see cref="T:System.Drawing.RectangleF"/> structure.
        /// </summary>
        /// <param name="rect"><see cref="T:System.Drawing.RectangleF"/> structure to combine. </param>
        /// <param name="combineMode">Member of the <see cref="T:System.Drawing.Drawing2D.CombineMode"/> enumeration that specifies the combining operation to use. </param>
        public override void SetClipRect(Rectangle rect, CombineMode combineMode = CombineMode.Replace)
        {

            gx.SetClip(
               this.currentClipRect = new System.Drawing.Rectangle(
                    rect.X, rect.Y,
                    rect.Width, rect.Height),
                    (System.Drawing.Drawing2D.CombineMode)combineMode);
        }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:14,代码来源:2_MyGdiPlusCanvas_CoordinateAndClip.cs

示例6: test

        static void test(CombineMode mode, IDrawingTarget target, IDrawingBackend backend)
        {
            var c1 = backend.Ellipse(15, 5, 30, 30);
            var c2 = backend.Ellipse(35, 5, 30, 30);

            var r = c1.Combine(mode, c2);

            target.Fill(color: new Color(0.7, 0.7, 1.0));
            target.Geometry(r);
        }
开发者ID:pragmatrix,项目名称:CrossUI,代码行数:10,代码来源:GeometryCombineTests.cs

示例7: Data

 public Data()
 {
     this.basePath = new PdnGraphicsPath();
     this.continuation = new PdnGraphicsPath();
     this.continuationCombineMode = CombineMode.Xor;
     this.cumulativeTransform = new Matrix();
     this.cumulativeTransform.Reset();
     this.interimTransform = new Matrix();
     this.interimTransform.Reset();            
 }
开发者ID:metadeta96,项目名称:openpdn,代码行数:10,代码来源:Selection.cs

示例8: Combine

        public IGeometry Combine(CombineMode mode, IGeometry other)
        {
            var otherImplementation = other.import();

            var combined = Path.Geometry(
                Geometry.Factory,
                sink => Geometry.Combine(otherImplementation, mode.import(), sink));

            return new GeometryImplementation(combined);
        }
开发者ID:pragmatrix,项目名称:CrossUI,代码行数:10,代码来源:GeometryImplementation.cs

示例9: Combine

        public static List<List<Vector2>> Combine(List<List<Vector2>> subjectPolygons, List<List<Vector2>> clippingPolygons,
                                                  FillMode subjectFillMode, FillMode clipFillMode, CombineMode combineMode, out PolyTree tree)
        {
            Clipper.Clear();
            Clipper.AddPaths(subjectPolygons, PolyType.ptSubject, true);
            Clipper.AddPaths(clippingPolygons, PolyType.ptClip, true);

            tree = new PolyTree();
            Clipper.Execute(combineMode.ToClipType(), tree, subjectFillMode.ToPolyFillType(), clipFillMode.ToPolyFillType());
            return Clipper.ClosedPathsFromPolyTree(tree);
        }
开发者ID:Artentus,项目名称:GameUtils,代码行数:11,代码来源:ClipperHelper.cs

示例10: AnonymousCommandWrapper

 /// <summary>
 /// Initializes a new instance of the <see cref="AnonymousCommandWrapper"/> class.
 /// </summary>
 /// <param name="serviceProvider">A service provider that can provide a <see cref="ITransactionalActionStack"/> to use for this view model.</param>
 /// <param name="name">The name of this command.</param>
 /// <param name="combineMode">The combine mode to apply to this command.</param>
 /// <param name="redo">The do/redo function.</param>
 /// <param name="undo">The undo action, if the command can be undone.</param>
 /// <param name="dirtiables">The <see cref="IDirtiableViewModel"/> instances associated to this command.</param>
 /// <param name="discardTransactions">The transaction will be discarded if true, otherwise it is ended.</param>
 public AnonymousCommandWrapper(IViewModelServiceProvider serviceProvider, string name, CombineMode combineMode, Func<object, UndoToken> redo, Action<object, UndoToken> undo, IEnumerable<IDirtiableViewModel> dirtiables, bool discardTransactions = true)
     : base(serviceProvider, dirtiables)
 {
     if (name == null) throw new ArgumentNullException(nameof(name));
     if (redo == null) throw new ArgumentNullException(nameof(redo));
     Name = name;
     CombineMode = combineMode;
     this.redo = (parameter, creatingActionItem) => redo(parameter);
     this.undo = undo;
     DiscardTransactions = discardTransactions;
 }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:21,代码来源:AnonymousCommandWrapper.cs

示例11: AnonymousCommandWrapper

 /// <summary>
 /// Initializes a new instance of the <see cref="AnonymousCommandWrapper"/> class.
 /// </summary>
 /// <param name="serviceProvider">A service provider that can provide a <see cref="ITransactionalActionStack"/> to use for this view model.</param>
 /// <param name="name">The name of this command.</param>
 /// <param name="combineMode">The combine mode to apply to this command.</param>
 /// <param name="redo">The do/redo function.</param>
 /// <param name="undo">The undo action, if the command can be undone.</param>
 /// <param name="dirtiables">The <see cref="IDirtiableViewModel"/> instances associated to this command.</param>
 public AnonymousCommandWrapper(IViewModelServiceProvider serviceProvider, string name, CombineMode combineMode, Func<object, UndoToken> redo, Action<object, UndoToken> undo, IEnumerable<IDirtiableViewModel> dirtiables)
     : base(serviceProvider, dirtiables)
 {
     if (name == null) throw new ArgumentNullException("name");
     if (redo == null) throw new ArgumentNullException("redo");
     this.name = name;
     this.combineMode = combineMode;
     this.redo = redo;
     this.undo = undo;
     this.serviceProvider = serviceProvider;
 }
开发者ID:robterrell,项目名称:paradox,代码行数:20,代码来源:AnonymousCommandWrapper.cs

示例12: SetClipRect

        /// <summary>
        /// Sets the clipping region of this <see cref="T:System.Drawing.Graphics"/> to the result of the specified operation combining the current clip region and the rectangle specified by a <see cref="T:System.Drawing.RectangleF"/> structure.
        /// </summary>
        /// <param name="rect"><see cref="T:System.Drawing.RectangleF"/> structure to combine. </param>
        /// <param name="combineMode">Member of the <see cref="T:System.Drawing.Drawing2D.CombineMode"/> enumeration that specifies the combining operation to use. </param>
        public override void SetClipRect(Rectangle rect, CombineMode combineMode = CombineMode.Replace)
        {
            skCanvas.ClipRect(this.currentClipRect = new SkiaSharp.SKRect(
                rect.Left, rect.Top,
                rect.Right, rect.Bottom));

            //gx.SetClip(
            //   this.currentClipRect = new System.Drawing.Rectangle(
            //        rect.X, rect.Y,
            //        rect.Width, rect.Height),
            //        (System.Drawing.Drawing2D.CombineMode)combineMode);
        }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:17,代码来源:2_MySkiaCanvas_CoordinateAndClip.cs

示例13: AnonymousCommandWrapper

 /// <summary>
 /// Initializes a new instance of the <see cref="AnonymousCommandWrapper"/> class.
 /// </summary>
 /// <param name="serviceProvider">A service provider that can provide a <see cref="ITransactionalActionStack"/> to use for this view model.</param>
 /// <param name="name">The name of this command.</param>
 /// <param name="combineMode">The combine mode to apply to this command.</param>
 /// <param name="redo">The do/redo function.</param>
 /// <param name="undo">The undo action, if the command can be undone.</param>
 /// <param name="dirtiables">The <see cref="IDirtiableViewModel"/> instances associated to this command.</param>
 /// <param name="discardTransactions">The transaction will be discarded if true, otherwise it is ended.</param>
 public AnonymousCommandWrapper(IViewModelServiceProvider serviceProvider, string name, CombineMode combineMode, Func<object, bool, UndoToken> redo, Action<object, UndoToken> undo, IEnumerable<IDirtiableViewModel> dirtiables, bool discardTransactions = true)
     : base(serviceProvider, dirtiables)
 {
     if (name == null) throw new ArgumentNullException("name");
     if (redo == null) throw new ArgumentNullException("redo");
     this.name = name;
     this.combineMode = combineMode;
     this.redo = redo;
     this.undo = undo;
     this.serviceProvider = serviceProvider;
     this.DiscardTransactions = discardTransactions;
     this.AllowReentrancy = false;
 }
开发者ID:releed,项目名称:paradox,代码行数:23,代码来源:AnonymousCommandWrapper.cs

示例14: OnMouseDown

		protected override void OnMouseDown (Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, Cairo.PointD point)
		{
			if (is_drawing)
				return;

			hist = new SelectionHistoryItem (Icon, Name);
			hist.TakeSnapshot ();

			combine_mode = PintaCore.Workspace.SelectionHandler.DetermineCombineMode (args);			
			path = null;
			is_drawing = true;

			var doc = PintaCore.Workspace.ActiveDocument;
			doc.PreviousSelection.Dispose ();
			doc.PreviousSelection = doc.Selection.Clone();
		}
开发者ID:msiyer,项目名称:Pinta,代码行数:16,代码来源:LassoSelectTool.cs

示例15: Check

        public static bool Check(CombineMode combineMode)
        {
            switch (combineMode)
            {
                case CombineMode.Exclude:
                case CombineMode.Intersect:
                case CombineMode.Union:
                case CombineMode.Xor:
                    return true;

                case CombineMode.Complement:
                case CombineMode.Replace:
                default:
                    return false;
            }
        }
开发者ID:KrisJanssen,项目名称:SIS,代码行数:16,代码来源:Polygon.cs


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