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

C# Forms.PaintEventArgs类代码示例

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

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



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

示例1: OnPaint

 protected override void OnPaint(PaintEventArgs pevent)
 {
     GraphicsPath grPath = new GraphicsPath();
     grPath.AddEllipse(0, 0, ClientSize.Width, ClientSize.Height);
     this.Region = new System.Drawing.Region(grPath);
     base.OnPaint(pevent);
 }
开发者ID:Sensco,项目名称:TestRunner,代码行数:7,代码来源:RoundButton.cs


示例2: BrowserPaint

        private void BrowserPaint(object sender, PaintEventArgs e)
        {
            browser.Paint -= BrowserPaint;

            //Invalidate browser as short term fix for #522
            browser.Invalidate();
        }
开发者ID:nick121212,项目名称:xima_desktop3,代码行数:7,代码来源:SimpleBrowserForm.cs


示例3: OnPaint

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

            if (grContext != null)
            {
                var desc = new GRBackendRenderTargetDesc
                {
                    Width = Width,
                    Height = Height,
                    Config = GRPixelConfig.Bgra8888,
                    Origin = GRSurfaceOrigin.TopLeft,
                    SampleCount = 1,
                    StencilBits = 0,
                    RenderTargetHandle = IntPtr.Zero,
                };

                using (var surface = SKSurface.Create(grContext, desc))
                {
                    var skcanvas = surface.Canvas;

                    sample.Method(skcanvas, Width, Height);

                    skcanvas.Flush();
                }

                SwapBuffers();
            }
        }
开发者ID:Core2D,项目名称:SkiaSharp,代码行数:29,代码来源:SkiaGLControl.cs


示例4: xpanel_Paint

		void xpanel_Paint(object sender, PaintEventArgs e)
		{
			if (this.mRefreshMode != RegionRefreshMode.Always)
			{
				this.Render();
			}
		}
开发者ID:mind0n,项目名称:hive,代码行数:7,代码来源:XnaPanel.cs


示例5: PictureBoxPaint

        private void PictureBoxPaint(object sender, PaintEventArgs e)
        {
            var bitmaps = _goldBoxFile.Bitmaps;

            const int padding = 6;
            var x = 0;
            var y = 0;
            var bitmapCount = bitmaps.Count;
            var rowImageHeight = 0;

            for (var i = 0; i < bitmapCount; i++)
            {
                var currentImage = bitmaps[i];

                if (x + (currentImage.Width * Zoom) > ContainerWidth)
                {
                    x = 0;
                    y += rowImageHeight + (int)(padding * Zoom);
                    rowImageHeight = (int)(currentImage.Height * Zoom);
                }
                else
                {
                    rowImageHeight = Math.Max(rowImageHeight, (int)(currentImage.Height * Zoom));
                }

                e.Graphics.DrawImage(currentImage, x, y, currentImage.Width * Zoom, currentImage.Height * Zoom);
                x += (int)((currentImage.Width + padding) * Zoom);
            }

            _pictureBox.Width = ContainerWidth;
            _pictureBox.Height = y + (int)((rowImageHeight * Zoom));
        }
开发者ID:bsimser,项目名称:goldbox,代码行数:32,代码来源:FruaTlbViewer.cs


示例6: OnPaintBackground

 protected override void OnPaintBackground(PaintEventArgs e)
 {
     var page = Program.MainWindow.navigationControl.CurrentNavigatable as Control;
     if (page?.BackgroundImage != null) this.RenderControlBgImage(page, e);
     else e.Graphics.Clear(Config.BgColor);
     FrameBorderRenderer.Instance.RenderToGraphics(e.Graphics, DisplayRectangle, FrameBorderRenderer.StyleType.Shraka);
 }
开发者ID:DeinFreund,项目名称:Zero-K-Infrastructure,代码行数:7,代码来源:HostDialog.cs


示例7: PictureBoxPaint

        private void PictureBoxPaint(object sender, PaintEventArgs e)
        {

            var bitmaps = _file.Bitmaps;

            const int padding = 6;
            var x = 0;
            var y = 25;
            var bitmapCount = bitmaps.Count;
            var rowImageHeight = 0;
            
            for (var i = 0; i < bitmapCount; i++)
            {
                var currentImage = bitmaps[i];
                // make sure walls are displayed a row at a time - ie start a new row at 10, 20, 29, 38 + 47 if we have a wallTLB
                if (x + (currentImage.Width * Zoom) > ContainerWidth || (_wallTlb && (i % 47 == 10 || i % 47 == 20 || i % 47 == 29 || i % 47 == 38 || i % 47 == 0)))
                {
                    x = 0;
                    y += rowImageHeight + (int)(padding * Zoom);
                    rowImageHeight = (int)(currentImage.Height * Zoom);
                }
                else
                {
                    rowImageHeight = Math.Max(rowImageHeight, (int)(currentImage.Height * Zoom));
                }

                e.Graphics.DrawImage(currentImage, x, y, currentImage.Width * Zoom, currentImage.Height * Zoom);
                x += (int)((currentImage.Width + padding) * Zoom);
            }

            _pictureBox.Width = ContainerWidth;
            _pictureBox.Height = y + (int)((rowImageHeight * Zoom));
        }
开发者ID:bsimser,项目名称:goldbox,代码行数:33,代码来源:FruaTlbViewer.cs


示例8: DrawAll

 public void DrawAll(PaintEventArgs e)
 {
     foreach (IDrawable drawit in drawable)
     {
         drawit.Draw(e);
     }
 }
开发者ID:nandorsoma,项目名称:LameSnakeGame,代码行数:7,代码来源:GameControl.cs


示例9: OnPaint

        protected override void OnPaint(PaintEventArgs e)
        {
            Debug.WriteLine("OnPaint");

            //draw something on the back surface

            var p1 = new PointD(10, 10);
            var p2 = new PointD(100, 10);
            var p3 = new PointD(100, 100);
            var p4 = new PointD(10, 100);

            BackContext.SetSourceColor(new Cairo.Color(1,0,0));
            BackContext.MoveTo(p1);
            BackContext.LineTo(p2);
            BackContext.LineTo(p3);
            BackContext.LineTo(p4);
            BackContext.LineTo(p1);
            BackContext.ClosePath();
            BackContext.Stroke();

            BackContext.SetSourceColor(new Cairo.Color(0, 1, 0));
            BackContext.MoveTo(new PointD(p3.X + 10, p3.Y + 10));
            Cairo.Path path = DWriteCairo.RenderLayoutToCairoPath(BackContext, textLayout);
            BackContext.AppendPath(path);
            path.Dispose();
            BackContext.Fill();

            //copy back surface to font surface
            SwapBuffer();
        }
开发者ID:zwcloud,项目名称:ZWCloud.DwriteCairo,代码行数:30,代码来源:Form1.cs


示例10: OnPaint

        /// <summary>
        /// 绘制界面
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPaint(PaintEventArgs e)
        {
            if (Columns.Count != 0)
            {
                this.Columns["ID"].Visible = false;
                this.Columns["State"].Visible = false;
                this.Columns["Ver"].Visible = false;
                this.Columns["Group"].Visible = false;
                this.Columns["NoAnswer"].Visible = false;

                this.Columns["CmdVersion"].Visible = false;
                this.Columns["CmdPolling"].Visible = false;
                this.Columns["CmdPollingRight"].Visible = false;
                this.Columns["CmdReset"].Visible = false;
                this.Columns["IsPointSelect"].Visible = false;
                this.Columns["CmdTwo"].Visible = false;
                this.Columns["IsTwo"].Visible = false;
                this.Columns["IpAddress"].Visible = false;
                this.Columns["Port"].Visible = false;
                this.Columns["SCmd"].Visible = false;
                this.Columns["SaveCount"].Visible = false;
                this.Columns["TimeCheckOut"].Visible = false;
                this.Columns["StationModel"].Visible = false;

                this.Columns["Address"].HeaderText = "地址";
                this.Columns["Address"].Width = 60;
                this.Columns["Address"].DisplayIndex = 0;

                this.Columns["CState"].HeaderText = "状态描述";
                this.Columns["CState"].Width = 100;
                this.Columns["CState"].DisplayIndex = 1;
            }

            base.OnPaint(e);
        }
开发者ID:ZoeCheck,项目名称:128_5.6_2010,代码行数:39,代码来源:DGStation.cs


示例11: OnPaint

        protected override void OnPaint(PaintEventArgs e)
        {
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;

            base.OnPaint(e);
        }
开发者ID:tgjones,项目名称:apesharp,代码行数:7,代码来源:NonFlickerPanel.cs


示例12: OnPaint

 // Draw the new button.
 protected override void OnPaint(PaintEventArgs e)
 {
     GraphicsPath grPath = new GraphicsPath();
         grPath.AddEllipse(10, 10, 60, 60);
         this.Region = new System.Drawing.Region(grPath);
         base.OnPaint(e);
 }
开发者ID:vavio,项目名称:Kids-vs-IceCream,代码行数:8,代码来源:RoundButton.cs


示例13: OnPaint

 protected override void OnPaint(PaintEventArgs pe)
 {
     pe.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
     pe.Graphics.CompositingMode = CompositingMode.SourceCopy;
     pe.Graphics.PixelOffsetMode = PixelOffsetMode.Half;
     base.OnPaint(pe);
 }
开发者ID:Lannyland,项目名称:IPPA,代码行数:7,代码来源:MyPictureBox.cs


示例14: OnPaint

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

            int x = (SplitterRectangle.Width - Properties.Resources.longGripOff.Width) / 2;
            e.Graphics.DrawImageUnscaled(Properties.Resources.longGripOff, x, SplitterRectangle.Top);
        }
开发者ID:SteGriff,项目名称:WirelessFireless,代码行数:7,代码来源:GripSplitContainer.cs


示例15: OnPaint

 protected override void OnPaint(PaintEventArgs e)
 {
     //this.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     //            | System.Windows.Forms.AnchorStyles.Right)));
     //this.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular);
     base.OnPaint(e);
 }
开发者ID:neozhu,项目名称:wmsrf-winceclient,代码行数:7,代码来源:rfButtonCommand.cs


示例16: OnPaintAdornments

		/// <summary>
		/// Receives a call when the control that the designer is managing has painted its surface so the designer can paint any additional adornments on top of the control.
		/// </summary>
		/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> the designer can use to draw on the control.</param>
		protected override void OnPaintAdornments(PaintEventArgs e)
		{
			if (_switchButton != null)
			{
				NuGenDesignerRenderer.DrawAdornments(e.Graphics, _switchButton.ClientRectangle);
			}
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:11,代码来源:NuGenSwitchButtonDesigner.cs


示例17: NormalOperation

		public void NormalOperation()
		{
			// need to create a dummy form because PaintEventArgs wants a Graphics object
			using (DummyForm dummy = new DummyForm())
			{
				dummy.Create();
				using (TestControl1 tc1 = new TestControl1())
				{
					Message m1 = Message.Create(IntPtr.Zero, 10, new IntPtr(101), new IntPtr(1001));
					tc1.CallWndProc(ref m1);
					Message m2 = Message.Create(IntPtr.Zero, 20, new IntPtr(201), new IntPtr(2001));
					tc1.CallWndProc(ref m2);
					using (var g = dummy.CreateGraphics())
					{
						using (var pe1 = new PaintEventArgs(g, new System.Drawing.Rectangle(0, 1, 2, 3)))
						{
							tc1.CallOnPaint(pe1);
							Message m3 = Message.Create(IntPtr.Zero, 30, new IntPtr(301), new IntPtr(3001));
							tc1.CallWndProc(ref m3);
							object[] expected = { m1, m1, m2, m2, pe1, pe1, m3, m3 };
							VerifyArray(expected, tc1);
						}
					}
				}
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:26,代码来源:TestMessageSequencer.cs


示例18: glCanvas1_OpenGLDraw

        private void glCanvas1_OpenGLDraw(object sender, PaintEventArgs e)
        {
            //OpenGL.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT | OpenGL.GL_STENCIL_BUFFER_BIT);

            //Point mousePosition = this.glCanvas1.PointToClient(Control.MousePosition);
            this.scene.Render();
        }
开发者ID:bitzhuwei,项目名称:CSharpGL,代码行数:7,代码来源:Form15UIRenderer.cs


示例19: OnPaintBackground

 protected override void OnPaintBackground(PaintEventArgs e)
 {
     if (!this.IsTransparent)
     {
         base.OnPaintBackground(e);
     }
 }
开发者ID:sankarvema,项目名称:AIM,代码行数:7,代码来源:TransparentPictureBox.cs


示例20: OnPaint

 /// <summary>
 ///  Overrides the Painting logic because painting will be handled
 ///  using timers and DirectX.  If the control is in design mode, then
 ///  clear it because DirectX isn't available yet.
 /// </summary>
 /// <param name="e">Graphics context objects</param>
 protected override void OnPaint(PaintEventArgs e)
 {
     if (DesignMode)
     {
         e.Graphics.Clear(BackColor);
     }
 }
开发者ID:Carolasb,项目名称:Terrarium,代码行数:13,代码来源:DirectDrawPictureBox.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Forms.Panel类代码示例发布时间:2022-05-26
下一篇:
C# Forms.PageSetupDialog类代码示例发布时间: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