自定义图片填充工作流外观

protected override Size OnLayoutSize(ActivityDesignerLayoutEventArgs e)
        {
            return new Size(70, 60);
        }

protected override void OnPaint(ActivityDesignerPaintEventArgs e)
        {

            Rectangle frameRect = new Rectangle(this.Location.X, this.Location.Y, this.Size.Width, this.Size.Height);
            Rectangle titleRect = new Rectangle(frameRect.X, frameRect.Y, frameRect.Width, 30);
            Rectangle imageRect = new Rectangle((titleRect.X + 35), titleRect.Y + 30, this.Size.Width - 66, 30);

            Image mImage = Properties.Resources.FaultHandleActivity;
            e.Graphics.DrawImage(mImage, imageRect);

            ActivityDesignerPaint.DrawText(e.Graphics, new Font("Segoe UI", 8), parentActivity.ActivityTitle, titleRect,    StringAlignment.Center, e.AmbientTheme.TextQuality, Brushes.DarkGreen);

                   
           
        }

阅读更多

没有更多推荐了,返回首页