DesignerGlyph.OnPaint Método

Definición

Cuando se invalida en una clase derivada, se realiza cualquier tarea requerida para representar el glifo en la superficie del diseñador de actividad.

protected:
 abstract void OnPaint(System::Drawing::Graphics ^ graphics, bool activated, System::Workflow::ComponentModel::Design::AmbientTheme ^ ambientTheme, System::Workflow::ComponentModel::Design::ActivityDesigner ^ designer);
protected abstract void OnPaint (System.Drawing.Graphics graphics, bool activated, System.Workflow.ComponentModel.Design.AmbientTheme ambientTheme, System.Workflow.ComponentModel.Design.ActivityDesigner designer);
abstract member OnPaint : System.Drawing.Graphics * bool * System.Workflow.ComponentModel.Design.AmbientTheme * System.Workflow.ComponentModel.Design.ActivityDesigner -> unit
Protected MustOverride Sub OnPaint (graphics As Graphics, activated As Boolean, ambientTheme As AmbientTheme, designer As ActivityDesigner)

Parámetros

graphics
Graphics

Graphics para realizar el relleno y el dibujo de las tareas.

activated
Boolean

true para indicar que el glifo aparece en la superficie de diseño; de lo contrario, false.

ambientTheme
AmbientTheme

Utilice la propiedad AmbientTheme para tener acceso a los valores de propiedades de ambiente.

designer
ActivityDesigner

ActivityDesigner del que obtener información sobre las acciones del usuario.

Ejemplos

En el siguiente ejemplo de código se muestra cómo invalidar el método OnPaint. El código personaliza cómo dibujar el objeto de glifo en el diseñador de actividad al que el glifo está asociado.

Este ejemplo de código forma parte del ejemplo SDK del monitor de flujo de trabajo del archivo DesignerGlyphProvider.cs. Para obtener más información, consulte Monitor de flujo de trabajo.

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);
}
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

Comentarios

OnPaint utiliza CommentIndicatorPen para dibujar los límites del glifo del comentario y CommentIndicatorBrush para rellenarlo.

Se aplica a

Consulte también