DesignerGlyph.OnPaint Method
When overridden in a derived class, performs any tasks required to render the glyph on the activity designer surface.
Assembly: System.Workflow.ComponentModel (in System.Workflow.ComponentModel.dll)
'Declaration Protected MustOverride Sub OnPaint ( _ graphics As Graphics, _ activated As Boolean, _ ambientTheme As AmbientTheme, _ designer As ActivityDesigner _ ) 'Usage Dim graphics As Graphics Dim activated As Boolean Dim ambientTheme As AmbientTheme Dim designer As ActivityDesigner Me.OnPaint(graphics, activated, ambientTheme, _ designer)
Parameters
- graphics
- Type: System.Drawing.Graphics
The Graphics to perform fill and drawing tasks.
- activated
- Type: System.Boolean
true to indicate that the glyph appears on the design surface; otherwise, false.
- ambientTheme
- Type: System.Workflow.ComponentModel.Design.AmbientTheme
The AmbientTheme to use to access ambient property settings.
- designer
- Type: System.Workflow.ComponentModel.Design.ActivityDesigner
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 Overrides Sub OnPaint(ByVal graphics As System.Drawing.Graphics, ByVal activated As Boolean, ByVal ambientTheme As System.Workflow.ComponentModel.Design.AmbientTheme, ByVal designer As System.Workflow.ComponentModel.Design.ActivityDesigner) Dim bitmap As Bitmap = AppResources.Executing bitmap.MakeTransparent(Color.FromArgb(0, 255, 255)) If Not bitmap Is Nothing Then graphics.DrawImage(bitmap, GetBounds(designer, activated), New Rectangle(Point.Empty, bitmap.Size), GraphicsUnit.Pixel) End If End Sub
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.