當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.PaintEventArgs類代碼示例

本文整理匯總了C#中System.Windows.Forms.PaintEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# PaintEventArgs類的具體用法?C# PaintEventArgs怎麽用?C# PaintEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PaintEventArgs類屬於System.Windows.Forms命名空間,在下文中一共展示了PaintEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.Windows.Forms.PaintEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。