• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Drawing.PaintEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



PaintEventArgs类属于System.Drawing命名空间,在下文中一共展示了PaintEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PlotPanelPaint

 void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     var borderPen = new Pen (Brushes.Black,1);
     g.DrawRectangle (borderPen, (float)panel1.Bounds.X, (float)panel1.Bounds.Y, (float)panel1.Bounds.Width, (float)panel1.Bounds.Height);
     borderPen.Dispose ();
     float a = panel1.Height / 4;
     var dc = new DrawCylinder (this, a, 2 * a);
     dc.DrawIsometricView (g);
 }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:10,代码来源:ChartCanvas.cs


示例2: Draw

		public override void Draw(PaintEventArgs e, PaintState paintstate)
        {
			Rectangle rect;
			Point start = DrawStartPosition;
			rect = new Rectangle(start, new Size(DrawEndPosition.X - start.X, DrawEndPosition.Y - start.Y));
            e.Graphics.DrawEllipse(GetForgroundPen(paintstate), rect);
        }
开发者ID:aiten,项目名称:CNCLib,代码行数:7,代码来源:Ellipse.cs


示例3: OnPaint

		protected override void OnPaint (PaintEventArgs e)
		{
			base.OnPaint (e);

			ChartGraphics g = new ChartGraphics (e.Graphics);

			PaintElement (g, this, new ElementPosition (0, 0, 100, 100));

			foreach (var area in ChartAreas)
				PaintElement (g, area, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));

			foreach (var series in Series)
				PaintElement (g, series, new ElementPosition (9.299009f, 6.15f, 86.12599f, 81.1875f));
		}
开发者ID:GirlD,项目名称:mono,代码行数:14,代码来源:Chart.cs


示例4: Form1_Paint

        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            Graphics myGraphics = e.Graphics;

            myGraphics.Clear(Color.White);
            double radius = 5;
            for (int j = 1; j <= 25; j++)
            {
                radius = (j + 1) * 5;
                for (double i = 0.0; i < 360.0; i += 0.1)
                {
                    double angle = i * System.Math.PI / 180;
                    int x = (int)(150 + radius * System.Math.Cos(angle));
                    int y = (int)(150 + radius * System.Math.Sin(angle));

                    PutPixel(myGraphics, x, y, Color.Red);
                    //System.Threading.Thread.Sleep(1); // If you want to draw circle very slowly.
                }
            }
            myGraphics.Dispose();
        }
开发者ID:0xack13,项目名称:LegacyDraw,代码行数:21,代码来源:Program.cs


示例5: OnPaint

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            CalendarRendererEventArgs evt = new CalendarRendererEventArgs(this, e.Graphics, e.ClipRectangle);

            ///Calendar background
            Renderer.OnDrawBackground(evt);

            /// Headers / Timescale
            switch (DaysMode)
            {
                case CalendarDaysMode.Short:
                    Renderer.OnDrawDayNameHeaders(evt);
                    Renderer.OnDrawWeekHeaders(evt);
                    break;
                case CalendarDaysMode.Expanded:
                    Renderer.OnDrawTimeScale(evt);
                    break;
                default:
                    throw new NotImplementedException("Current DaysMode not implemented");
            }

            ///Days on view
            Renderer.OnDrawDays(evt);

            ///Items
            Renderer.OnDrawItems(evt);

            ///Overflow marks
            Renderer.OnDrawOverflows(evt);
        }
开发者ID:StephOfPixVert,项目名称:PlanningLab,代码行数:32,代码来源:Calendar.cs


示例6: DrawRect

        public override void DrawRect(CGRect dirtyRect)
        {
            Graphics g = Graphics.FromCurrentContext();
            g.Clear(backColor);

            Rectangle clip = new Rectangle((int)dirtyRect.X,
                                           (int)dirtyRect.Y,
                                           (int)dirtyRect.Width,
                                           (int)dirtyRect.Height);

            var args = new PaintEventArgs(g, clip);

            OnPaint(args);

            if(Paint != null)
            {
                Paint(this, args);
            }
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:19,代码来源:DrawingView.cs


示例7: MainView_Paint

 private void MainView_Paint(object sender, PaintEventArgs e)
 {
     Font font = new Font("Tahoma", 12f, FontStyle.Regular);
     Graphics graphics = e.Graphics;
     graphics.DrawString("Number of clicks: " + iClicks.ToString(), font, new SolidBrush(this.Title.TextColor), (float)8, (float)30);
 }
开发者ID:aprilix,项目名称:helloworldn2,代码行数:6,代码来源:MainView.cs


示例8: dialog_button_Paint

		private void dialog_button_Paint(object sender, PaintEventArgs e) {
			// best way to draw the ellipse?
			e.Graphics.DrawString("...", new Font(Font,FontStyle.Bold), Brushes.Black, 0,0);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:4,代码来源:PropertyGridTextBox.cs


示例9: Draw

        public override void Draw(RectangleF dirtyRect)
        {
            if(Paint != null)
            {
                Graphics g = Graphics.FromCurrentContext();
                Rectangle clip = new Rectangle((int)dirtyRect.X,
                                               (int)dirtyRect.Y,
                                               (int)dirtyRect.Width,
                                               (int)dirtyRect.Height);

                var args = new PaintEventArgs(g, clip);

                Paint(this, args);
            }
        }
开发者ID:asfungithub,项目名称:sysdrawing-coregraphics,代码行数:15,代码来源:PlotPanel.cs


示例10: OnPaint

        protected void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.InterpolationMode = InterpolationMode.NearestNeighbor;

            g.Clear (Color.Wheat);
            switch (currentView) {
                case 0:
                DrawImage1 (g);
                break;
                case 1:
                DrawImage2 (g);
                break;
                case 2:
                DrawImage3 (g);
                break;
                case 3:
                DrawImage4 (g);
                break;
                case 4:
                DrawImage5 (g);
                break;
                case 5:
                DrawImage6 (g);
                break;
                case 6:
                DrawImage7 (g);
                break;
                case 7:
                DrawImage8 (g);
                break;
                case 8:
                DrawImage9 (g);
                break;
                case 9:
                DrawImagePageUnit (g);
                break;
                case 10:
                DrawImagePageUnit_2 (g);
                break;
                case 11:
                DrawImagePageUnit_3 (g);
                break;
                case 12:
                DrawImagePageUnit_4 (g);
                break;
                case 13:
                DrawImagePageUnitClip (g);
                break;
            case 14:
                DrawImageTranslateClip (g);
                break;
            case 15:
                FillRegionIntersect (g);
                break;
            case 16:
                DrawImageIntersectClip (g);
                break;
            }

            g.PageUnit = GraphicsUnit.Pixel;
            Brush sBrush = Brushes.Black;

            g.ResetTransform ();

            if (!g.IsClipEmpty) {
                var clipPoint = Point.Empty;
                var clipString = string.Format ("Clip-{0}", g.ClipBounds);
                g.ResetClip ();
                var clipSize = g.MeasureString (clipString, clipFont);
                clipPoint.X = (int)(ClientRectangle.Width / 2 - clipSize.Width / 2);
                clipPoint.Y = 5;
                g.DrawString (clipString, clipFont, sBrush, clipPoint);
            }

            var anyKeyPoint = Point.Empty;
            var anyKey = "Tap screen to continue.";
            var anyKeySize = g.MeasureString (anyKey, anyKeyFont);
            anyKeyPoint.X = ((int)(ClientRectangle.Width / 2 - anyKeySize.Width / 2));
            anyKeyPoint.Y = (int)(ClientRectangle.Height - anyKeySize.Height + 10);
            g.DrawString(anyKey, anyKeyFont, sBrush, anyKeyPoint );

            anyKeySize = g.MeasureString (title, anyKeyFont);
            anyKeyPoint.X = (int)(ClientRectangle.Width / 2 - anyKeySize.Width / 2);
            anyKeyPoint.Y -= (int)anyKeySize.Height;
            g.DrawString (title, anyKeyFont, sBrush, anyKeyPoint );

            g.Dispose ();
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:89,代码来源:DrawingView.cs


示例11: OnPaintBackground

		protected override void OnPaintBackground (PaintEventArgs pevent)
		{
			base.OnPaintBackground (pevent);
		}
开发者ID:GirlD,项目名称:mono,代码行数:4,代码来源:Chart.cs


示例12: DoPaint

        protected void DoPaint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawImage(graphImage, 0,26);

            base.OnPaint(e);
        }
开发者ID:aprilix,项目名称:NeoRhythm,代码行数:6,代码来源:StandardGraphView.cs


示例13: Draw

        public override void Draw(CGRect rect)
        {
            Graphics g = Graphics.FromCurrentContext();
            g.Clear(backColor);

            var clip = new Rectangle ((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height);
            var args = new PaintEventArgs(g, clip);

            OnPaint (args);
            Paint?.Invoke (this, args);
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:11,代码来源:DrawingView.cs


示例14: PlotPanelPaint

 private void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     AddData();
     cs.PlotPanelStyle(g);
     dc.AddStockChart(g, cs);
 }
开发者ID:asfungithub,项目名称:sysdrawing-coregraphics,代码行数:7,代码来源:ChartCanvas.cs


示例15: PlotPanelPaint

 private void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     g.SmoothingMode = SmoothingMode.AntiAlias;
     AddData();
     ds.AddPie(g, cs);
     lg.AddLegend(g, ds, cs);
 }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:8,代码来源:ChartCanvas.cs


示例16: OnPaint

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);

            e.Graphics.Clear(SystemColors.Window);

            for (int i = 0; i < Months.Length; i++)
            {
                if (Months[i].Bounds.IntersectsWith(e.ClipRectangle))
                {
                    #region MonthTitle

                    string title = Months[i].Date.ToString(MonthTitleFormat);
                    MonthViewBoxEventArgs evtTitle = new MonthViewBoxEventArgs(e.Graphics, Months[i].MonthNameBounds,
                        title,
                        Focused ? MonthTitleTextColor : MonthTitleTextColorInactive,
                        Focused ? MonthTitleColor : MonthTitleColorInactive);

                    DrawBox(evtTitle);

                    #endregion

                    #region DayNames

                    for (int j = 0; j < Months[i].DayNamesBounds.Length; j++)
                    {
                        MonthViewBoxEventArgs evtDay = new MonthViewBoxEventArgs(e.Graphics, Months[i].DayNamesBounds[j], Months[i].DayHeaders[j],
                            StringAlignment.Far, ForeColor, DayBackgroundColor);

                        DrawBox(evtDay);
                    }

                    if (Months[i].DayNamesBounds != null && Months[i].DayNamesBounds.Length != 0)
                    {
                        using (Pen p = new Pen(MonthTitleColor))
                        {
                            int y = Months[i].DayNamesBounds[0].Bottom;
                            e.Graphics.DrawLine(p, new Point(Months[i].Bounds.X, y), new Point(Months[i].Bounds.Right, y));
                        }
                    }
                    #endregion

                    #region Days
                    foreach (MonthViewDay day in Months[i].Days)
                    {
                        if (!day.Visible) continue;

                        MonthViewBoxEventArgs evtDay = new MonthViewBoxEventArgs(e.Graphics, day.Bounds, day.Date.Day.ToString(),
                            StringAlignment.Far,
                            day.Grayed ? DayGrayedText : (day.Selected ? DaySelectedTextColor : ForeColor),
                            day.Selected ? DaySelectedBackgroundColor : DayBackgroundColor);

                        if (day.Date.Equals(DateTime.Now.Date))
                        {
                            evtDay.BorderColor = TodayBorderColor;
                        }

                        DrawBox(evtDay);
                    }
                    #endregion 

                    #region Arrows

                    if (i == 0)
                    {
                        Rectangle r = BackwardButtonBounds;
                        using (Brush b = new SolidBrush(BackwardButtonSelected ? ArrowsSelectedColor : ArrowsColor))
                        {
                            e.Graphics.FillPolygon(b, new Point[] { 
                                new Point(r.Right, r.Top),
                                new Point(r.Right, r.Bottom - 1),
                                new Point(r.Left + r.Width / 2, r.Top + r.Height / 2),
                            });
                        }
                    }

                    if (i == _forwardMonthIndex)
                    {
                        Rectangle r = ForwardButtonBounds;
                        using (Brush b = new SolidBrush(ForwardButtonSelected ? ArrowsSelectedColor : ArrowsColor))
                        {
                            e.Graphics.FillPolygon(b, new Point[] { 
                                new Point(r.X, r.Top),
                                new Point(r.X, r.Bottom - 1),
                                new Point(r.Left + r.Width / 2, r.Top + r.Height / 2),
                            });
                        }
                    }

                    #endregion
                }
            }
        }
开发者ID:Hujairi,项目名称:CMS,代码行数:93,代码来源:MonthView.cs


示例17: OnPaint

        protected void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.SmoothingMode = SmoothingMode.AntiAlias;

            switch (currentView)
            {
            case 0:
                PaintView0 (g);
                break;
            case 1:
                PaintView1 (g);
                break;
            case 2:
                GlassSphere (g);
                break;
            case 3:
                BlendingIn (g);
                break;
            case 4:
                PaintView3 (g);
                break;
            case 5:
                PaintViewB (g);
                break;
            case 6:
                PaintView4 (g);
                break;
            case 7:
                PaintView5 (g);
                break;
            case 8:
                PaintView6 (g);
                break;
            case 9:
                PaintView7 (g);
                break;
            };

            g.ResetTransform ();
            Brush sBrush = Brushes.Black;

            if (!g.IsClipEmpty)
            {
                var clipPoint = PointF.Empty;
                var clipString = string.Format("Clip-{0}", g.ClipBounds);
                g.ResetClip ();
                var clipSize = g.MeasureString(clipString, clipFont);
                clipPoint.X = (ClientRectangle.Width / 2) - (clipSize.Width / 2);
                clipPoint.Y = 5;
                g.DrawString(clipString, clipFont, sBrush, clipPoint );

            }

            var anyKeyPoint = PointF.Empty;
            var anyKey = "Press any key to continue.";
            var anyKeySize = g.MeasureString(anyKey, anyKeyFont);
            anyKeyPoint.X = (ClientRectangle.Width / 2) - (anyKeySize.Width / 2);
            anyKeyPoint.Y = ClientRectangle.Height - (anyKeySize.Height + 10);
            g.DrawString(anyKey, anyKeyFont, sBrush, anyKeyPoint );

            anyKeySize = g.MeasureString(title, anyKeyFont);
            anyKeyPoint.X = (ClientRectangle.Width / 2) - (anyKeySize.Width / 2);
            anyKeyPoint.Y -= anyKeySize.Height;
            g.DrawString(title, anyKeyFont, sBrush, anyKeyPoint );

            g.Dispose();
        }
开发者ID:mono,项目名称:sysdrawing-coregraphics,代码行数:68,代码来源:DrawingView.cs


示例18: OnPaint

        protected override void OnPaint(PaintEventArgs pe)
        {
            string methodCountMessage = null, description;
            if (DataProvider == null || DataProvider.InsightDataCount < 1) {
                description = "Unknown Method";
            } else {
            //				if (DataProvider.InsightDataCount > 1) {
            //					StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
            //					stringParserService.Properties["CurrentMethodNumber"]  = (CurrentData + 1).ToString();
            //					stringParserService.Properties["NumberOfTotalMethods"] = DataProvider.InsightDataCount.ToString();
            //					methodCountMessage = stringParserService.Parse("${res:MonoDevelop.DefaultEditor.Gui.Editor.InsightWindow.NumberOfText}");
            //				}

                description = DataProvider.GetInsightData(CurrentData);
            }

            TipPainterTools.DrawHelpTipFromCombinedDescription(this, pe.Graphics,
                Font, methodCountMessage, description);
        }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:19,代码来源:InsightWindow.cs


示例19: ImagePanel_Paint

        private void ImagePanel_Paint(object sender, PaintEventArgs e)
        {
            if (bpp == ImageBitsPerPixel.Eight)
            {
                if (pix8.Count > 0)
                {
                    Graphics g = Graphics.FromHwnd(panel.Handle);
                    if (newImage == true)
                    {
                        g.Clear(SystemColors.Control);
                        newImage = false;
                    }

                    g.DrawImage(bmp, hOffset, vOffset);
                    g.Dispose();
                }
            }
            else if (bpp == ImageBitsPerPixel.Sixteen)
            {
                if (pix16.Count > 0)
                {
                    Graphics g = Graphics.FromHwnd(panel.Handle);
                    if (newImage == true)
                    {
                        g.Clear(SystemColors.Control);
                        newImage = false;
                    }

                    g.DrawImage(bmp, hOffset, vOffset);
                    g.Dispose();
                }
            }
            else //if (bpp == ImageBitsPerPixel.TwentyFour)  // 30 July 2010
            {
                if (pix24.Count > 0)
                {
                    Graphics g = Graphics.FromHwnd(panel.Handle);
                    if (newImage == true)
                    {
                        g.Clear(SystemColors.Control);
                        newImage = false;
                    }

                    g.DrawImage(bmp, hOffset, vOffset);
                    g.Dispose();
                }
            }
        }
开发者ID:rafikmatta,项目名称:dicom-leap-app,代码行数:48,代码来源:ImagePanelControl.xaml.cs


示例20: OnPaintBackground

 protected override void OnPaintBackground(PaintEventArgs pe)
 {
     pe.Graphics.FillRectangle(SystemBrushes.Info, pe.ClipRectangle);
 }
开发者ID:slluis,项目名称:monodevelop-prehistoric,代码行数:4,代码来源:InsightWindow.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Drawing.Pen类代码示例发布时间:2022-05-26
下一篇:
C# Drawing.ImageConverter类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap