• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CombineMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ClipPath

        public static GraphicsPath ClipPath(GraphicsPath subjectPath, CombineMode combineMode, GraphicsPath clipPath)
        {
            GpcWrapper.Polygon.Validate(combineMode);

            GpcWrapper.Polygon basePoly = new GpcWrapper.Polygon(subjectPath);

            GraphicsPath clipClone = (GraphicsPath)clipPath.Clone();
            clipClone.CloseAllFigures();
            GpcWrapper.Polygon clipPoly = new GpcWrapper.Polygon(clipClone);
            clipClone.Dispose();

            GpcWrapper.Polygon clippedPoly = GpcWrapper.Polygon.Clip(combineMode, basePoly, clipPoly);

            GraphicsPath returnPath = clippedPoly.ToGraphicsPath();
            returnPath.CloseAllFigures();
            return returnPath;
        }
开发者ID:metadeta96,项目名称:openpdn,代码行数:17,代码来源:PdnGraphics.cs


示例17: SetClip

 public void SetClip(Region region, CombineMode combineMode = CombineMode.Replace)
 {
     switch (combineMode)
     {
         case CombineMode.Intersect:
             _clip.Intersect(region);
             break;
         case CombineMode.Complement:
             _clip.Complement(region);
             break;
         case CombineMode.Exclude:
             _clip.Exclude(region);
             break;
         case CombineMode.Union:
             _clip.Union(region);
             break;
         case CombineMode.Xor:
             _clip.Xor(region);
             break;
         default:
             _clip = region;
             break;
     }
 }
开发者ID:dteunkenstt,项目名称:SVG,代码行数:24,代码来源:DebugRenderer.cs


示例18: ImageFrame

 public ImageFrame(ImageFrame f1, ImageFrame f2, CombineMode mode)
 {
     switch (mode)
     {
         case CombineMode.SideBySide:
             f1.OffsetX = 0;
             f2.OffsetX = f1.Width;
             Width = f1.Width + f2.Width;
             Height = Math.Max(f1.Height, f2.Height);
             break;
         case CombineMode.OneBelowOther:
             f1.OffsetY = 0;
             f2.OffsetY = f1.Height;
             Width = Math.Max(f1.Width, f2.Width);
             Height = f1.Height + f2.Height;
             break;
         default:
             throw new ArgumentException("invalid combine mode");
     }
     //Console.WriteLine(string.Format("New Combo: {0}x{1}, from f1 {2}x{3}, f2 {4}x{5}", Width, Height, f1.Width, f1.Height, f2.Width, f2.Height));
     SubFrames = new ImageFrame[2];
     SubFrames[0] = f1;
     SubFrames[1] = f2;
 }
开发者ID:akmurray,项目名称:aaronkmurray-blog-tools,代码行数:24,代码来源:ImageFrame.cs


示例19: SetClip

        public void SetClip(Region region, CombineMode combineMode)
        {
            // We need to reset the clip that is active now so that the graphic
            // states are correct when we set them.
            ResetClip ();

            switch (combineMode)
            {
            case CombineMode.Replace:
                // Set our clip region by cloning the region that is passed for now
                clipRegion = region.Clone ();
                break;
            case CombineMode.Intersect:

                clipRegion.Intersect (region);

                break;
            case CombineMode.Union:

                clipRegion.Union (region);

                break;
            case CombineMode.Exclude:

                clipRegion.Exclude (region);

                break;
            case CombineMode.Xor:

                clipRegion.Xor (region);

                break;
            default:
                throw new NotImplementedException ("SetClip for CombineMode " + combineMode + " not implemented");
            }

            //Unlike the current path, the current clipping path is part of the graphics state.
            //Therefore, to re-enlarge the paintable area by restoring the clipping path to a
            //prior state, you must save the graphics state before you clip and restore the graphics
            //state after you’ve completed any clipped drawing.
            context.SaveState ();
            if (clipRegion.IsEmpty) {
                context.ClipToRect (CGRect.Empty);
            } else {
                //context.ClipToRect ((RectangleF)clipRegion.regionObject);
                context.AddPath (clipRegion.regionPath);
                context.ClosePath ();
                context.Clip ();
            }
            clipSet++;
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:51,代码来源:Graphics.cs


示例20: OnMouseDown

        protected override void OnMouseDown(MouseEventArgs e)
        {
            Cursor = Cursors.WaitCursor;

            if ((ModifierKeys & Keys.Control) != 0 && e.Button == MouseButtons.Left)
            {
                this.combineMode = CombineMode.Union;
            }
            else if ((ModifierKeys & Keys.Alt) != 0 && e.Button == MouseButtons.Left)
            {
                this.combineMode = CombineMode.Exclude;
            }
            else if ((ModifierKeys & Keys.Control) != 0 && e.Button == MouseButtons.Right)
            {
                this.combineMode = CombineMode.Xor;
            }
            else if ((ModifierKeys & Keys.Alt) != 0 && e.Button == MouseButtons.Right)
            {
                this.combineMode = CombineMode.Intersect;
            }
            else
            {
                this.combineMode = AppEnvironment.SelectionCombineMode;
            }

            base.OnMouseDown(e);
        }
开发者ID:metadeta96,项目名称:openpdn,代码行数:27,代码来源:MagicWandTool.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CombinedQuery类代码示例发布时间:2022-05-24
下一篇:
C# Combatant类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap