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


C# Drawing.PaintEventArgs类代码示例

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


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


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