WorkflowView.ViewPortRectangle 属性

定义

获取 ViewPortRectangle 的当前 WorkflowView

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

描述屏幕上可见区域的 Rectangle

示例

下面的示例演示处理 WorkflowView 对象的 Paint 事件以直接在 WorkflowView 上绘制图像的方法。 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 包含工作流的可见区域。

适用于