Yes perfectly it works fine and now i have another Question related to container node. i use the custom class which you gave me before for rounded corder container node. in which am trying to add an image as background for that container , please gothru the coding that am using image object and Texturebrush to implement this features, but what am getting is the image is tiled one after another in the container instead of stretching to the size of the container node.
Public Overloads Overrides Sub Draw(ByVal graphics As MindFusion.Drawing.IGraphics, ByVal options As RenderOptions) If Not ShouldRender() Then Exit Sub End If
Dim brushBounds As Rect = GetBounds() Dim fillBrush As Brush = IIf(options.EnableInterior, Brush.CreateGdiBrush(brushBounds, -brushBounds.X, -brushBounds.Y), New SolidBrush(Color.FromArgb(0, 255, 255, 255)))
'Dim img As Image = frmConfirm_EMP_INS_Allocation.imgContainers.Images(imageIndex) 'Dim fBrush As New System.Drawing.TextureBrush(img) 'Dim fillBrush As Brush = IIf(options.EnableBackgroundImage, fBrush, Brush.CreateGdiBrush(brushBounds, -brushBounds.X, -brushBounds.Y))
Dim borderPen As Pen = Pen.CreateGdiPen()
' draw the container frame Dim rect As Rect = GetBounds()
Dim roundRect As GraphicsPath = InternalUtils.GetRoundRect(rect.X, rect.Y, rect.Width, rect.Height, 3) graphics.FillPath(fillBrush, roundRect) graphics.DrawPath(borderPen, roundRect) roundRect.Dispose()
If CaptionHeight > 0 Then ' draw the caption If options.Scale > 1 AndAlso Caption.Length > 0 AndAlso options.EnableText Then ' create a hyperlink Dim setLink As Boolean = Not String.IsNullOrEmpty(HyperLink) AndAlso options.HyperLinkStyle <> HyperLinkStyle.None If setLink Then graphics.BeginHyperLink(HyperLink, options.HyperLinkTarget) End If
' draw the caption text Dim captionBrush As Brush = New SolidBrush(CaptionColor) graphics.DrawString(Caption, Font, captionBrush, GetCaptionRect(), CaptionFormat) captionBrush.Dispose()
' close the hyperlink tag If setLink Then graphics.EndHyperLink() End If End If
' Draw the caption divider line If rect.Top + CaptionHeight < rect.Bottom Then graphics.DrawLine(borderPen, New Point(rect.Left, rect.Top + CaptionHeight), New Point(rect.Right, rect.Top + CaptionHeight)) End If End If
' Draw the fold button DrawManipulators(graphics, False)
' Cleanup borderPen.Dispose() fillBrush.Dispose() End Sub
|