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


C# Bitmap.DrawEllipse方法代码示例

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


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

示例1: PaintSkinnyHands

        public void PaintSkinnyHands(Bitmap screen, Time time)
        {
            PaintHourHand(screen, Color.White, 3, time.CurrentTime.Hour, time.CurrentTime.Minute);
            PaintMinuteHand(screen, Color.White, 2, time.CurrentTime.Minute,
                                           time.CurrentTime.Second);
            //PaintSecondHand(screen,Color.White, 1, time.CurrentTime.Second);

            screen.DrawEllipse(Color.White, 1, Program.Center.X, Program.Center.Y, 3, 3, Color.White, 0, 0,
                                  Color.White, 0, 0, 255);
            screen.DrawEllipse(Color.White, 1, Program.Center.X, Program.Center.Y, 2, 2, Color.Black, 0, 0,
                                              Color.White, 0, 0, 255);

        }
开发者ID:nothingmn,项目名称:Agent.TripleFace,代码行数:13,代码来源:AnalogFace.cs

示例2: RenderEllipse

        protected internal override void RenderEllipse(Bitmap bmp, Pen pen, int x, int y, int xRadius, int yRadius)
        {
            Color outlineColor = (pen != null) ? pen.Color : (Color)0x0;
            ushort outlineThickness = (pen != null) ? pen.Thickness : (ushort)0;

            if (bmp != null)
                bmp.DrawEllipse((MSMedia.Color)outlineColor, outlineThickness, x, y, xRadius, yRadius, (MSMedia.Color)Color, 0, 0, (MSMedia.Color)Color, 0, 0, Opacity);
        }
开发者ID:KonstantinKolesnik,项目名称:MFE,代码行数:8,代码来源:SolidColorBrush.cs

示例3: Main

        public static void Main()
        {
            LCD myApplication = new LCD();

            Window mainWindow = myApplication.CreateWindow();
            
            // Start the application
            //myApplication.Run(mainWindow);

            Bitmap bitmap1 = new Bitmap(SystemMetrics.ScreenWidth,SystemMetrics.ScreenHeight);
            Bitmap bitmap2 = new Bitmap(SystemMetrics.ScreenWidth, SystemMetrics.ScreenHeight);

            int ox = 0;
            int oy = 0;
            int rx = bitmap1.Width;
            int ry = bitmap1.Height;
            int sd=0;
            if (rx < ry)
                sd = rx;
            else
                sd = ry;


	    //
	    // Draw Diagonals
	    //
            bitmap1.DrawLine(Colors.Blue, 3, 0, 0, rx, ry);
            bitmap1.DrawLine(Colors.Blue, 3, rx, 0, 0, ry);

            bitmap2.DrawLine(Colors.Red, 3, 0, 0, rx, ry);
            bitmap2.DrawLine(Colors.Red, 3, rx, 0, 0, ry);


            for(int ioff=0; ioff < sd; ioff += 10)
	    {
		int oX  = ox+ioff;
		int oY  = oy+ioff;
		int wX  = rx - 2*ioff;
		int wY  = ry - 2*ioff;
                bitmap1.DrawRectangle(Colors.White, 1, oX, oY, wX, wY, 1, 1, 
                    Colors.Green, ox, oy, Colors.Green, rx, ry, 0xFF);
                bitmap2.DrawEllipse(Colors.White, rx/2, ry/2, wX, wY);
	    }

            


            while (true)
            {
                bitmap1.Flush();
                Thread.Sleep(250);
                bitmap2.Flush();
                Thread.Sleep(200);
            }

        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:56,代码来源:lcd.cs

示例4: Run

        public override void Run()
        {
            try
            {
                using (var bmp = new Bitmap(Dimensions.Width, Dimensions.Height))
                {
                    var rand = new Random();

                    for (int i = 0; i < 100; i++)
                    {
                        int radius = rand.Next(100);
                        bmp.DrawEllipse((Color) rand.Next(0xFFFFFF), 1,
                                        rand.Next(Dimensions.Width), rand.Next(Dimensions.Height),
                                        radius, radius, 0, 0, 0, 0, 0, 0, 0);
                        bmp.Flush();
                    }
                }
                Pass = true;
            }
            catch (Exception e)
            {
                UnexpectedException(e);
            }
        }
开发者ID:dario-l,项目名称:kodfilemon.blogspot.com,代码行数:24,代码来源:RandomDrawCircle.cs

示例5: PaintHands

        /// <summary>
        /// Paint all hands, a 0 width will not force the hand to not print.
        /// </summary>
        /// <param name="screen"></param>
        /// <param name="foreColor"></param>
        /// <param name="hourWidth"></param>
        /// <param name="minuteWidth"></param>
        /// <param name="secondWidth"></param>
        /// <param name="hour"></param>
        /// <param name="minute"></param>
        /// <param name="second"></param>
        public void PaintHands(Bitmap screen, Color foreColor, int hourWidth, int minuteWidth, int secondWidth, int hour,
                               int minute, int second)
        {
            if (hourWidth > 0) PaintHourHand(screen, foreColor, hourWidth, hour, minute);
            if (minuteWidth > 0) PaintMinuteHand(screen, foreColor, minuteWidth, minute, second);
            if (secondWidth > 0) PaintSecondHand(screen, foreColor, secondWidth, second);

            screen.DrawEllipse(foreColor, 1, AGENT.Center.X, AGENT.Center.Y, 3, 3, Color.White, 0, 0, Color.White, 0, 0,
                               255);
            screen.DrawEllipse(foreColor, 1, AGENT.Center.X, AGENT.Center.Y, 2, 2, Color.Black, 0, 0, Color.White, 0, 0,
                               255);

        }
开发者ID:nothingmn,项目名称:WP8-Running.AGENT,代码行数:24,代码来源:Drawing.cs

示例6: DrawItem

            protected override void DrawItem(Bitmap screen, int x, int y, int width, int height, ref int index, object item, Style cStyle)
            {
                bool selected = _selItem == item;

                if (selected)
                {
                    screen.DrawRectangle(Colors.Blue, 0, x, y, width, height, 0, 0,
                        cStyle.ListBoxSelectedItemBack1, x, y,
                        cStyle.ListBoxSelectedItemBack2, x, y + height, 256);
                }

                Font textFont = cStyle.LabelFont;
                Color textColor = selected ? cStyle.TextBoxPressedTextColor : cStyle.TextBoxEnabledTextColor;
                screen.DrawTextInRect(item.ToString(), x + 5, y + (height - textFont.Height) / 2, width - 10, height, Bitmap.DT_AlignmentLeft, textColor, textFont);

                const int rdMargin = 3;
                int rdX = x + _width - ItemHeight - rdMargin,
                    rdY = y + rdMargin,
                    rdRadius = (ItemHeight - rdMargin * 2) / 2;

                Color bColor = cStyle.RadioButtonEnabledBack;

                screen.DrawEllipse(cStyle.RadioButtonEnabledBorder, 1, rdX + rdRadius, rdY + rdRadius, rdRadius, rdRadius, bColor, 0, 0, bColor, 0, 0, 256);

                if (selected)
                {
                    const int margin = 6;
                    Color pointColor = cStyle.RadioButtonEnabledPoint;

                    _desktopOwner._screenBuffer.DrawEllipse(pointColor, 0, rdX + rdRadius, rdY + rdRadius, rdRadius - margin, rdRadius - margin,
                        pointColor, 0, 0, pointColor, 0, 0, 256);
                }
            }
开发者ID:andrei-tatar,项目名称:MediaPlayer.NETMF,代码行数:33,代码来源:ComboBoxListViewDesktop.cs


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