We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Creating bitmapnode programmatically

I am trying to create a symbol programmatically in vb.net 2005, i dont get an error but the symbol is not displayed, if i remove 'Me.AppendChild(m_BitmapNode)' then i see the rectangle otherwise i dont see anything.

' Add an outer rectangle
Me.m_OuterRect = New Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80)
Me.m_OuterRect.Name = "Rectangle"
Me.m_OuterRect.FillStyle.Type = Syncfusion.Windows.Forms.Diagram.FillStyleType.LinearGradient
Me.m_OuterRect.FillStyle.ForeColor = System.Drawing.Color.White
Me.m_OuterRect.FillStyle.Color = Color.White
Me.m_OuterRect.ShadowStyle.Visible = True
Me.m_OuterRect.EditStyle.AllowSelect = False
Me.AppendChild(m_OuterRect)

' Add BitmapNode
Try
Me.m_BitmapNode = New BitmapNode("c:\8662_executive_sip_endpoint_2.bmp")
Me.m_BitmapNode.Name = "Image"
Me.m_BitmapNode.EditStyle.AllowSelect = False
Me.AppendChild(m_BitmapNode)
Catch ex As Exception

End Try

3 Replies

J. J.Nagarajan Syncfusion Team May 11, 2007 03:59 PM UTC

Hi Robin,

If you want to add an image to the symbol then you can add the BitmapNode in MySymbol class. Please refer to the following code snippet

Me.outerRect = New Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80)
Me.outerRect.Name = "Rectangle"
Me.outerRect.FillStyle.Type = Syncfusion.Windows.Forms.Diagram.FillStyleType.LinearGradient
Me.outerRect.FillStyle.ForeColor = System.Drawing.Color.Orange
Me.outerRect.FillStyle.Color = Color.Orange
Me.outerRect.ShadowStyle.Visible = True
Me.AppendChild(outerRect)

Dim bmpnode As BitmapNode = New BitmapNode("..\..ature.jpg")
bmpnode.Bounds = New RectangleF(60,40,60,40)
bmpnode.Name="Image"
Me.AppendChild(bmpnode)

I have attached the sample for your reference. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Diagram.Windows/F60786/main.htm

Please refer to the sample and let me know if you have any questions

Regards,
Nagaraj


RR Robin Russell May 11, 2007 04:21 PM UTC

I have read your response, i am using version 5.1.0.51 of syncfusion and it seems that 'bounds' is not valid on a bitmap node!
and thus i cannot use:
bmpnode As BitmapNode = New BitmapNode("..\..ature.jpg")
bmpnode.Bounds = New RectangleF(60,40,60,40)<




>Hi Robin,

If you want to add an image to the symbol then you can add the BitmapNode in MySymbol class. Please refer to the following code snippet

Me.outerRect = New Syncfusion.Windows.Forms.Diagram.Rectangle(0, 0, 120, 80)
Me.outerRect.Name = "Rectangle"
Me.outerRect.FillStyle.Type = Syncfusion.Windows.Forms.Diagram.FillStyleType.LinearGradient
Me.outerRect.FillStyle.ForeColor = System.Drawing.Color.Orange
Me.outerRect.FillStyle.Color = Color.Orange
Me.outerRect.ShadowStyle.Visible = True
Me.AppendChild(outerRect)

Dim bmpnode As BitmapNode = New BitmapNode("..\..ature.jpg")
bmpnode.Bounds = New RectangleF(60,40,60,40)
bmpnode.Name="Image"
Me.AppendChild(bmpnode)

I have attached the sample for your reference. You can download the sample from the following page.

http://websamples.syncfusion.com/samples/Diagram.Windows/F60786/main.htm

Please refer to the sample and let me know if you have any questions

Regards,
Nagaraj


J. J.Nagarajan Syncfusion Team May 12, 2007 12:01 AM UTC

Hi Robin,

Thanks for the information

If you want to add the image in a Node then you have to the following code snippet in CustomNode class

Dim bmp As BitmapNode = New BitmapNode("..\..\Sun.bmp")
bmp.PinPoint = New PointF(20, 30)
bmp.Size = New SizeF(30, 20)
Me.AppendChild(bmp)

Please let me know if you have any questions.

Thanks,
Nagaraj

Loader.
Live Chat Icon For mobile
Up arrow icon