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


C# Graphics.FillCircle方法代码示例

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


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

示例1: DoPaint

        public override void DoPaint(Graphics g, int w, int h)
        {
            var radius = Math.Min(w, h)/2 - 100;
            var radiusDot = 50;
            var xC = w / 2;
            var yC = h / 2;

            g.FillBackground(w, h, PPP.brushWhite);
            g.FillCircle(PPP.brushLightGrayA, xC, yC, radius);
            g.FillCircle(PPP.brushWhite, xC, yC, radius-radiusDot*2);
            var alpha = Frame * ALPHA_FACTOR;
            var xClock = xC + Math.Cos(alpha) * (radius - radiusDot);
            var yClock = yC + Math.Sin(alpha) * (radius - radiusDot);
            var brushBreath = (xClock > xC)
                ? PPP.brushDefault
                : PPP.brushWhite;
            g.FillCircle(brushBreath, (int)xClock, (int)yClock, radiusDot);
        }
开发者ID:miktemk,项目名称:MiktemkPersonalToys,代码行数:18,代码来源:AnimationBreathWheel.cs

示例2: DrawBall

 private void DrawBall(Graphics g, ISimulation s)
 {
     g.FillCircle(_ballBrush, s.Ball.Position, s.Ball.Radius);
     DrawDebugInfo(s.Ball, _ballBrush, _font, g);
 }
开发者ID:PurdueSIGAI,项目名称:SoccerApp,代码行数:5,代码来源:SimulationDrawingStrategy.cs

示例3: DrawSpaceMap_DrawHeightLine

 private void DrawSpaceMap_DrawHeightLine(Graphics g, Pen pen, Brush brush, double x, double zy, double z)
 {
     g.DrawLineD(pen, x, zy, x, z);
     g.FillCircle(brush, x, z, 6.0);
 }
开发者ID:Tapsmax,项目名称:ArtemisMissionEditor,代码行数:5,代码来源:PanelSpaceMap.cs

示例4: DrawSpaceMap

        public void DrawSpaceMap(Graphics g)
        {
            List<IDisposable> ListObjectsToDispose = new List<IDisposable>();

            #region INIT everything and DRAW Background

            int i, j, fleetNumber, podNumber, randomThreshold;
            double x, zy, z, xe, zye, ze, angle, radius1, radius2, radius3, angleStart, angleEnd;
            double sizeAnomaly, sizeVessel, sizeSelection,
                sizeNamelessBlackholeOuter, sizeNamelessBlackholeInner, sizeNamelessNebula, sizeNamelessAsteroid, sizeNamelessMineBright, sizeNamelessMineDark;
            string name;
            double screen_y_scale = Settings.Current.YScale * GetMapScale();

            //objects for every1
            Random rnd = new Random();

            //DRAW BACKGROUND
            g.Clear(Settings.Current.GetColor(MapColors.MapBackground));

            #endregion

            #region DRAW Nameless Objects

            // calculate sizes
            sizeNamelessNebula = Space.NebulaWidth * GetMapScale();
            sizeNamelessAsteroid = Space.AsteroidWidth * GetMapScale();
            sizeNamelessAsteroid = (sizeNamelessAsteroid < 7.0 ? 7.0 : sizeNamelessAsteroid);
            sizeNamelessMineBright = 9.0;
            sizeNamelessMineDark = 3.0;

            // nebulas
            Brush brushNebula = Settings.Current.GetBrush(MapColors.Nebula);
            ListObjectsToDispose.Add(brushNebula);
            Brush brushNebulaBG = Settings.Current.GetBrush(MapColors.NebulaBG);
            ListObjectsToDispose.Add(brushNebulaBG);
            Pen penNebula = new Pen(brushNebula, 1);
            ListObjectsToDispose.Add(penNebula);

            // astreoids
            Brush brushAsteroid = (sizeNamelessAsteroid > 12.5) ? Settings.Current.GetBrush(MapColors.AsteroidBright) : Settings.Current.GetBrush(MapColors.Asteroid);
            ListObjectsToDispose.Add(brushAsteroid);
            Brush brushAsteroidBG = Settings.Current.GetBrush(MapColors.AsteroidBG);
            ListObjectsToDispose.Add(brushAsteroidBG);
            Pen penAsteroid = new Pen(brushAsteroid, (int)Math.Round(sizeNamelessAsteroid / 5));
            ListObjectsToDispose.Add(penAsteroid);
            Pen penAsteroidBG = new Pen(brushAsteroidBG, (int)Math.Round(sizeNamelessAsteroid / 5));
            ListObjectsToDispose.Add(penAsteroidBG);

            // mines
            Brush brushMine = Settings.Current.GetBrush(MapColors.Mine);
            ListObjectsToDispose.Add(brushMine);
            Brush brushMineDark = Settings.Current.GetBrush(MapColors.MineDark);
            ListObjectsToDispose.Add(brushMineDark);
            Brush brushMineBG = Settings.Current.GetBrush(MapColors.MineBG);
            ListObjectsToDispose.Add(brushMineBG);
            Pen penMine = new Pen(brushMine, 1);
            ListObjectsToDispose.Add(penMine);
            Pen penMineDark = new Pen(brushMineDark, 1);
            ListObjectsToDispose.Add(penMineDark);
            Pen penMineBG = new Pen(brushMineBG, 1);
            ListObjectsToDispose.Add(penMineBG);

            //height
            Brush brushDarkHeight = Settings.Current.GetBrush(MapColors.MapNamelessHeightMarker);
            ListObjectsToDispose.Add(brushDarkHeight);
            Pen penDarkHeight = new Pen(brushDarkHeight, 1);
            ListObjectsToDispose.Add(penDarkHeight);

            // Background objects
            foreach (MapObjectNameless item in SpaceMap.BackgroundNamelessObjects)
            {
                randomThreshold = item._type == MapObjectNamelessType.asteroids ? 6 : 2; //random_threshold
                rnd = new Random(item.randomSeed);
                angleStart = item.A_Start_rad ?? 0.0;
                angleEnd = (item.A_End_rad ?? Math.PI * 2.0);
                if (angleStart > angleEnd)
                {
                    double tmp = angleEnd;
                    angleEnd = angleStart;
                    angleStart = tmp;
                }

                for (i = 0; i < item.count; i++)
                {
                    if (!DrawSpaceMap_GetPoint(screen_y_scale, rnd, item, i, angleStart, angleEnd, out x, out zy, out z))
                        continue;

                    if (!Settings.Current.UseYForNameless)
                        zy = z;

                    switch (item._type)
                    {
                        case MapObjectNamelessType.asteroids:
                            g.DrawCircle(penAsteroidBG, x, zy, sizeNamelessAsteroid);
                            break;
                        case MapObjectNamelessType.nebulas:
                            g.DrawCircle(penNebula, x, zy, sizeNamelessNebula);
                            g.FillCircle(brushNebulaBG, x, zy, sizeNamelessNebula);
                            break;
                        case MapObjectNamelessType.mines:
//.........这里部分代码省略.........
开发者ID:Tapsmax,项目名称:ArtemisMissionEditor,代码行数:101,代码来源:PanelSpaceMap.cs

示例5: Draw

 public override void Draw(Graphics g, float x, float y)
 {
     g.FillCircle(brush, x, y, Radius);
 }
开发者ID:DaveTheTroll,项目名称:RobotArena,代码行数:4,代码来源:Marker.cs


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