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);
 }
Example #2
0
		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);
        }
Example #3
0
File: Chart.cs Project: GirlD/mono
		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));
		}
        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 ();

            g.SmoothingMode = SmoothingMode.AntiAlias;
            float a;

            if (panel1.Height < panel1.Width)
                a = panel1.Height / 3;
            else
                a = panel1.Height / 4;

            var ds = new DrawSphere (this, a, 0, 0, -a / 2);
            ds.DrawIsometricView (g);
            ds = new DrawSphere(this, 2 * a / 3, -a/2, -a/2, a / 2);
            ds.DrawIsometricView (g);
        }
Example #5
0
        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();
        }
Example #6
0
        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);
        }
        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);
            }
        }
Example #8
0
 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);
 }
 void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     AddData (g);
     cs.PlotPanelStyle (g);
     dc.AddBars (g, cs, dc.DataSeriesList.Count, ds.PointList.Count);
 }
Example #10
0
		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);
		}
        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);
            }
        }
        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 ();
        }
Example #13
0
File: Chart.cs Project: GirlD/mono
		protected override void OnPaintBackground (PaintEventArgs pevent)
		{
			base.OnPaintBackground (pevent);
		}
Example #14
0
        protected void DoPaint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawImage(graphImage, 0,26);

            base.OnPaint(e);
        }
        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);
        }
 private void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     AddData();
     cs.PlotPanelStyle(g);
     dc.AddStockChart(g, cs);
 }
 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);
 }
Example #18
0
        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
                }
            }
        }
        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();
        }
        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);
        }
        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();
                }
            }
        }
 protected override void OnPaintBackground(PaintEventArgs pe)
 {
     pe.Graphics.FillRectangle(SystemBrushes.Info, pe.ClipRectangle);
 }
Example #23
0
		private void dropdown_button_Paint(object sender, PaintEventArgs e)
		{
			ThemeEngine.Current.CPDrawComboButton(e.Graphics, dropdown_button.ClientRectangle, dropdown_button.ButtonState);
		}
Example #24
0
		protected override void OnPaint (PaintEventArgs e)
		{
			base.OnPaint (e);
		}
        public override void DrawRect(System.Drawing.RectangleF dirtyRect)
        {
            if(Paint != null)
            {
                Graphics g = new Graphics();
                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);

                Paint(this, args);
            }
        }
 private void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     g.SmoothingMode = SmoothingMode.AntiAlias;
     AddData();
     cs.SetPolarAxes(g);
     dc.AddPolar(g,cs);
     lg.AddLegend(g, dc, cs);
     g.Dispose();
 }
Example #27
0
 public override void Draw(CGRect rect)
 {
     if (Paint != null) {
         Graphics g = Graphics.FromCurrentContext();
         var clip = new CGRect ((int)rect.X, (int)rect.Y, (int)rect.Width, (int)rect.Height);
         var args = new PaintEventArgs (g, clip);
         Paint(this, args);
     }
 }
        protected void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            g.InterpolationMode = InterpolationMode.NearestNeighbor;

            g.Clear(Color.White);
            //g.SmoothingMode = SmoothingMode.None;
            switch (currentView)
            {
            case 0:
                FillRegionInfinite (g);
                break;
            case 1:
                FillRegionEmpty (g);
                break;
            case 2:
                FillRegion1 (g);
                break;
            case 3:
                FillRegionIntersect (g);
                break;
            case 4:
                FillRegionUnion (g);
                break;
            case 5:
                FillRegionExclude (g);
                break;
            case 6:
                FillRegionXor(g);
                break;
            case 7:
                FillRegionInfiniteIntersect(g);
                break;
            case 8:
                FillRegionInfiniteUnion(g);
                break;
            case 9:
                FillRegionInfiniteExclude(g);
                break;
            case 10:
                FillRegionInfiniteXor(g);
                break;
            case 11:
                FillRegionEmptyIntersect(g);
                break;
            case 12:
                FillRegionEmptyUnion(g);
                break;
            case 13:
                FillRegionEmptyExclude(g);
                break;
            case 14:
                FillRegionEmptyXor(g);
                break;
            case 15:
                TranslateRegion(g);
                break;
            case 16:
                TransformRegion(g);
                break;
            case 17:
                RegionIsVisibleRectangleF(g);
                break;

            }

            Brush sBrush = Brushes.Black;

            g.ResetTransform ();

            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 = "Tap screen 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();
        }
 private void PlotPanelPaint(object sender, PaintEventArgs e)
 {
     Graphics g = e.Graphics;
     g.SmoothingMode = SmoothingMode.AntiAlias;
     AddData();
     cs.PlotPanelStyle(g);
     dc.AddAreas(g, cs, dc.DataSeriesList.Count, ds.PointList.Count);
 }
Example #30
0
		public abstract void Paint (PaintEventArgs pe);