This documentation is archived and is not being maintained.

DesignerGlyph.OnPaint Method

When overridden in a derived class, performs any tasks required to render the glyph on the activity designer surface.

Namespace: System.Workflow.ComponentModel.Design
Assembly: System.Workflow.ComponentModel (in system.workflow.componentmodel.dll)

protected abstract void OnPaint (
	Graphics graphics,
	bool activated,
	AmbientTheme ambientTheme,
	ActivityDesigner designer
)
protected abstract void OnPaint (
	Graphics graphics, 
	boolean activated, 
	AmbientTheme ambientTheme, 
	ActivityDesigner designer
)
protected abstract function OnPaint (
	graphics : Graphics, 
	activated : boolean, 
	ambientTheme : AmbientTheme, 
	designer : ActivityDesigner
)
Not applicable.

Parameters

graphics

The Graphics to perform fill and drawing tasks.

activated

true to indicate that the glyph appears on the design surface; otherwise, false.

ambientTheme

The AmbientTheme to use to access ambient property settings.

designer

The ActivityDesigner from which to obtain information about user actions.

OnPaint uses CommentIndicatorPen to draw the bounds of the comment glyph and CommentIndicatorBrush to fill it.

The following code example demonstrates how you can override the OnPaint method. The code customizes how to draw the glyph object on the activity designer with which the glyph is associated.

This code example is part of the Workflow Monitor SDK Sample from the DesignerGlyphProvider.cs file. For more information, see Workflow Monitor.

protected override void OnPaint(Graphics graphics, bool activated, AmbientTheme ambientTheme, ActivityDesigner designer)
{
    Bitmap bitmap = Resources.Executing;
    bitmap.MakeTransparent(Color.FromArgb(0, 255, 255));
    if (bitmap != null)
        graphics.DrawImage(bitmap, GetBounds(designer, activated), new Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel);
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: