本文整理汇总了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);
}
示例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);
}
示例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));
}
示例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();
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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 ();
}
示例11: OnPaintBackground
protected override void OnPaintBackground (PaintEventArgs pevent)
{
base.OnPaintBackground (pevent);
}
示例12: DoPaint
protected void DoPaint(object sender, PaintEventArgs e)
{
e.Graphics.DrawImage(graphImage, 0,26);
base.OnPaint(e);
}
示例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);
}
示例14: PlotPanelPaint
private void PlotPanelPaint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
AddData();
cs.PlotPanelStyle(g);
dc.AddStockChart(g, 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);
}