DesignerGlyph.OnPaint メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
派生クラスでオーバーライドされると、アクティビティ デザイナー画面にグリフをレンダリングするために必要なタスクを実行します。
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)
パラメーター
- 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 を使用してそれを塗りつぶします。
適用対象
こちらもご覧ください
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示