當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。