本文整理汇总了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);
}
示例2: BrowserPaint
private void BrowserPaint(object sender, PaintEventArgs e)
{
browser.Paint -= BrowserPaint;
//Invalidate browser as short term fix for #522
browser.Invalidate();
}
示例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();
}
}
示例4: xpanel_Paint
void xpanel_Paint(object sender, PaintEventArgs e)
{
if (this.mRefreshMode != RegionRefreshMode.Always)
{
this.Render();
}
}
示例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));
}
示例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);
}
示例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));
}
示例8: DrawAll
public void DrawAll(PaintEventArgs e)
{
foreach (IDrawable drawit in drawable)
{
drawit.Draw(e);
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}