共用方式為


WorkflowView.ViewPortRectangle 屬性

定義

取得 的目前 。

public:
 property System::Drawing::Rectangle ViewPortRectangle { System::Drawing::Rectangle get(); };
public System.Drawing.Rectangle ViewPortRectangle { get; }
member this.ViewPortRectangle : System.Drawing.Rectangle
Public ReadOnly Property ViewPortRectangle As Rectangle

屬性值

Rectangle ,描述螢幕上可見的區域。

範例

下列範例將示範處理 物件 Paint 事件的方法,在 上直接畫出圖形。 ViewPortRectangle 屬性傳回設計介面上的可視區域,以正確包含畫出的圖形。

void workflowView_Paint(object sender, PaintEventArgs e)
{
    using (Graphics g = this.workflowView.CreateGraphics())
    {
        Bitmap draftImage = Resources.draft;
        draftImage.MakeTransparent(Color.Magenta);
        g.DrawImage(draftImage, this.workflowView.ViewPortRectangle);
    }

    base.OnPaint(e);
}
Sub workflowView_Paint(ByVal sender As Object, ByVal e As PaintEventArgs)
    Using g As Graphics = Me.workflowView.CreateGraphics()
        Dim draftImage As Bitmap = Resources.draft
        draftImage.MakeTransparent(Color.Magenta)
        g.DrawImage(draftImage, Me.workflowView.ViewPortRectangle)
    End Using

    MyBase.OnPaint(e)
End Sub

備註

ViewPortRectangle 包含了工作流程的可見區域。

適用於