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


C# Gdk.DrawArc方法代码示例

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


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

示例1: drawCardFace

 public void drawCardFace(Gdk.Window win, Gdk.GC outline, Gdk.GC fill, int x, int y, int w, int h)
 {
     int top = y, bottom = h+y, left = x, right = w+x, corner = 25;
     int hcorner = (int)Math.Ceiling((double)corner/2); // half corner
     /* Outline of Arcs */
     win.DrawArc(outline, true, left-1, top-1, corner, corner, 90 * 64, 90 * 64);
     win.DrawArc(outline, true, left-1, bottom-corner+1, corner, corner, 180 * 64, 90 * 64);
     win.DrawArc(outline, true, right-corner+1, bottom-corner+1, corner, corner, 270 * 64, 90 * 64);
     win.DrawArc(outline, true, right-corner+1, top-1, corner, corner, 360 * 64, 90 * 64);
     /* Fill of Arcs */
     win.DrawArc(fill, true, left, top, corner, corner, 90 * 64, 90 * 64);
     win.DrawArc(fill, true, left, bottom-corner, corner, corner, 180 * 64, 90 * 64);
     win.DrawArc(fill, true, right-corner, bottom-corner, corner, corner, 270 * 64, 90 * 64);
     win.DrawArc(fill, true, right-corner, top, corner, corner, 360 * 64, 90 * 64);
     /* Fill of Card */
     win.DrawRectangle(fill, true, left+hcorner, top, right-left-corner, bottom-top);
     win.DrawRectangle(fill, true, left, top+hcorner, right-left, bottom-top-corner);
     /* Outline of Card */
     win.DrawLine(outline, left+hcorner, top, right-hcorner, top);
     win.DrawLine(outline, left+hcorner, bottom, right-hcorner, bottom);
     win.DrawLine(outline, left, top+hcorner, left, bottom-hcorner);
     win.DrawLine(outline, right, top+hcorner, right, bottom-hcorner);
 }
开发者ID:jcjones,项目名称:Gpremacy,代码行数:23,代码来源:DeckDealer.cs

示例2: DrawMarker

        //       *****
        /// <summary>
        /// Draws the marker (circle) inside the box
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="Unconditional"></param>
        private void DrawMarker( Gdk.Window win, int x, int y, bool Unconditional)
        {
            //	  *  |  *
            if ( x < 0 ) x = 0;												//	 *   |   *
            if ( x > this.Allocation.Width - 4 ) x = this.Allocation.Width - 4;					//	*    |    *
            if ( y < 0 ) y = 0;												//	*    |    *
            if ( y > this.Allocation.Height - 4 ) y = this.Allocation.Height - 4;					//	*----X----*
            //	*    |    *
            if ( m_iMarker_Y == y && m_iMarker_X == x && !Unconditional )	//	*    |    *
                return;														//	 *   |   *
            //	  *  |  *
            ClearMarker(win);													//	   *****

            m_iMarker_X = x;
            m_iMarker_Y = y;

            //Graphics g = Gtk.DotNet.Graphics.FromDrawable( win );

            //Pen pen;
            GraphUtil.HSL _hsl = GetColor(x,y);	//	The selected color determines the color of the marker drawn over
            //	it (black or white)
            Color color = Color.White;
            if ( _hsl.L < (double)200/255 )
                color = Color.White;									//	White marker if selected color is dark
            else if ( _hsl.H < (double)26/360 || _hsl.H > (double)200/360 )
                if ( _hsl.S > (double)70/255 )
                    color = Color.White;
                else
                    color = Color.Black;								//	Else use a black marker for lighter colors
            else
                color = Color.Black;

            Gdk.GC gc = new Gdk.GC( win );
            gc.RgbFgColor = GraphUtil.gdkColorFromWinForms( color );
            win.DrawArc( gc, false ,x - 3, y - 3, 10, 10, 0 * 64, 360 * 64 );

            //DrawBorder(win);		//	Force the border to be redrawn, just in case the marker has been drawn over it.
        }
开发者ID:tizianomanni,项目名称:holly-gtk-widgets,代码行数:45,代码来源:ColorPanel.cs


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