DesignerGlyph.OnPaint メソッド

定義

派生クラスでオーバーライドされると、アクティビティ デザイナー画面にグリフをレンダリングするために必要なタスクを実行します。

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)

パラメーター

graphics
Graphics

塗りつぶしと描画タスクを実行する Graphics

activated
Boolean

グリフをデザイン サーフェイスに表示する場合は true。それ以外の場合は false

ambientTheme
AmbientTheme

アンビエント プロパティ設定へのアクセスに使用する AmbientTheme

designer
ActivityDesigner

ユーザー アクションに関する情報の取得元の ActivityDesigner

次のコード例は、OnPaint メソッドをオーバーライドする方法を示しています。 このコードは、グリフが関連付けられているアクティビティ デザイナーへのグリフ オブジェクトの描画の仕方をカスタマイズしたものです。

このコード例は、DesignerGlyphProvider.cs ファイルに含まれている、ワークフロー モニターの SDK サンプルの一部です。 詳細については、「 ワークフロー モニター」を参照してください。

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

注釈

OnPaint は、CommentIndicatorPen を使用してコメント グリフの境界を描画し、CommentIndicatorBrush を使用してそれを塗りつぶします。

適用対象

こちらもご覧ください