Bagikan melalui


DesignerGlyph.OnPaint Metode

Definisi

Ketika ditimpa di kelas turunan, melakukan tugas apa pun yang diperlukan untuk merender glyph pada permukaan perancang aktivitas.

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)

Parameter

graphics
Graphics

Graphics untuk melakukan tugas isian dan gambar.

activated
Boolean

true untuk menunjukkan bahwa glyph muncul di permukaan desain; jika tidak, false.

ambientTheme
AmbientTheme

yang AmbientTheme digunakan untuk mengakses pengaturan properti sekitar.

designer
ActivityDesigner

dari ActivityDesigner mana untuk mendapatkan informasi tentang tindakan pengguna.

Contoh

Contoh kode berikut menunjukkan bagaimana Anda dapat mengambil alih OnPaint metode . Kode ini menyesuaikan cara menggambar objek glyph pada perancang aktivitas yang terkait dengan glyph.

Contoh kode ini adalah bagian dari Sampel SDK Monitor Alur Kerja dari file DesignerGlyphProvider.cs. Untuk informasi selengkapnya, lihat Pemantauan Alur Kerja.

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

Keterangan

OnPaintCommentIndicatorPen menggunakan untuk menggambar batas glyph komentar dan CommentIndicatorBrush untuk mengisinya.

Berlaku untuk

Lihat juga