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


C# System.Drawing.Drawing2D.GraphicsPath.AddPie方法代码示例

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


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

示例1: DrawHover

        public void DrawHover(Graphics graphics, Rectangle bounds, double hoverDone)
        {
            using (Bitmap b = new Bitmap(mBackgroundImage, bounds.Size))
                graphics.DrawImage(b, bounds.Location);

            var path = new System.Drawing.Drawing2D.GraphicsPath();
            path.AddPie(bounds.X, bounds.Y, bounds.Width, bounds.Height, -90f, (float) (360 * hoverDone));
            graphics.SetClip(path);
            using (Bitmap b = new Bitmap(mImage, bounds.Size))
                graphics.DrawImage(b, bounds.Location);
            graphics.ResetClip();
        }
开发者ID:JohnMcCaffery,项目名称:ChimeraClean,代码行数:12,代码来源:ImageRenderer.cs

示例2: updateBorder

        private void updateBorder()
        {
            var imeInfo = _monitor.IMEStatus;
            _lastImeStatus = imeInfo;

            if (imeInfo.WindowHandle == this.Handle || !imeInfo.WindowVisible || imeInfo.Ignored) {
                this.Opacity = 0f;
                setTopMost(false);
            }
            else {
                var borderWidth = imeInfo.IMEEnabled ?
                    _settings.ImeOnBorderStyle.Width :
                    _settings.ImeOffBorderStyle.Width;

                Rectangle windowRect = imeInfo.ClientBounds;
                windowRect.Inflate(borderWidth, borderWidth);

                // スクリーン外にはみ出た部分を押し込む
                Rectangle screenRect = Screen.FromHandle(imeInfo.ClientHandle).Bounds;
                {
                    int left = windowRect.X;
                    int top = windowRect.Y;
                    int right = windowRect.Right;
                    int bottom = windowRect.Bottom;
                    if (left < screenRect.X) left = screenRect.X;
                    if (top < screenRect.Y) top = screenRect.Y;
                    if (right > screenRect.Right) right = screenRect.Right;
                    if (bottom > screenRect.Bottom) bottom = screenRect.Bottom;
                    windowRect = Rectangle.FromLTRB(left, top, right, bottom);
                }

                if (this.Size == windowRect.Size) {
                    this.Location = windowRect.Location;
                }
                else {
                    var path = new System.Drawing.Drawing2D.GraphicsPath();
                    var w = windowRect.Width;
                    var h = windowRect.Height;
                    var border2x = borderWidth * 2;
                    path.AddPie(0, 0, border2x, border2x, 180, 90);
                    path.AddPie(w - border2x, 0, border2x, border2x, 270, 90);
                    path.AddPie(0, h - border2x, border2x, border2x, 90, 90);
                    path.AddPie(w - border2x, h - border2x, border2x, border2x, 0, 90);
                    path.AddRectangle(new Rectangle(0, borderWidth, borderWidth, h - border2x));
                    path.AddRectangle(new Rectangle(borderWidth, 0, w - border2x, borderWidth));
                    path.AddRectangle(new Rectangle(w - borderWidth, borderWidth, borderWidth, h - border2x));
                    path.AddRectangle(new Rectangle(borderWidth, h - borderWidth, w - border2x, borderWidth));
                    this.Region = new Region(path);
                    this.Bounds = windowRect;
                }

                this.BackColor = imeInfo.IMEEnabled ?
                    _settings.ImeOnBorderStyle.GetColor() :
                    _settings.ImeOffBorderStyle.GetColor();
                this.Opacity = imeInfo.IMEEnabled ?
                    _settings.ImeOnBorderStyle.Opacity :
                    _settings.ImeOffBorderStyle.Opacity;
                setTopMost(true);
            }
        }
开发者ID:syego,项目名称:ime_status_monitor,代码行数:60,代码来源:MainForm.cs

示例3: CreateArc2D

            /// <summary>
            /// Creates a GraphicsPath object and adds an arc to it with the specified arc values and closure type.
            /// </summary>
            /// <param name="ellipseBounds">A RectangleF structure that represents the rectangular bounds of the ellipse from which the arc is taken.</param>
            /// <param name="start">The starting angle of the arc measured in degrees.</param>
            /// <param name="extent">The angular extent of the arc measured in degrees.</param>
            /// <param name="arcType">The closure type for the arc.</param>
            /// <returns>Returns a new GraphicsPath object that contains the arc path.</returns>
            public static System.Drawing.Drawing2D.GraphicsPath CreateArc2D(System.Drawing.RectangleF ellipseBounds, float start, float extent, int arcType)
            {
                System.Drawing.Drawing2D.GraphicsPath arc2DPath = new System.Drawing.Drawing2D.GraphicsPath();
                switch (arcType)
                {
                    case OPEN:
                        arc2DPath.AddArc(ellipseBounds, start * -1, extent * -1);
                        break;
                    case CLOSED:
                        arc2DPath.AddArc(ellipseBounds, start * -1, extent * -1);
                        arc2DPath.CloseFigure();
                        break;
                    case PIE:
                        arc2DPath.AddPie(ellipseBounds.X, ellipseBounds.Y, ellipseBounds.Width, ellipseBounds.Height, start * -1, extent * -1);
                        break;
                    default:
                        break;
                }

                return arc2DPath;
            }
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:SupportClass.cs

示例4: CalculateSegments

        private void CalculateSegments()
        {
            Rectangle rctFull = new Rectangle( 0, 0, Width, Height );
            Rectangle rctInner = new Rectangle( ((Width *  7) / 30),
                                                ((Height *  7) / 30),
                                                (Width -  ((Width *  14 ) / 30 )),
                                                (Height - ((Height * 14) / 30 )));

            System.Drawing.Drawing2D.GraphicsPath pthInnerBackground;

            // Create 12 segment pieces
            for ( int intCount=0; intCount < 12; intCount++ )
            {
                segmentPaths[ intCount ] = new System.Drawing.Drawing2D.GraphicsPath();

                // We subtract 90 so that the starting segment is at 12 o'clock
                segmentPaths[ intCount ].AddPie( rctFull, ( intCount * 30 ) - 90, 25 );
            }

            // Create the center circle cut-out
            pthInnerBackground = new System.Drawing.Drawing2D.GraphicsPath();
            pthInnerBackground.AddPie( rctInner, 0, 360 );
            innerBackgroundRegion = new Region( pthInnerBackground );
        }
开发者ID:uQr,项目名称:Visual-NHibernate,代码行数:24,代码来源:SpinningProgress.cs


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