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.
Unfortunately, activation email could not send to your email. Please try again.

Creating bitmapnode programmatically

Thread ID:

Created:

Updated:

Platform:

Replies:

60786 May 11,2007 09:19 AM May 11,2007 08:01 PM Windows Forms 3
loading
Tags: Diagram
Robin Russell
Asked On May 11, 2007 09:19 AM

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

J.Nagarajan [Syncfusion]
Replied On May 11, 2007 11:59 AM

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("..\..\nature.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

Robin Russell
Replied On May 11, 2007 12:21 PM

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("..\..\nature.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("..\..\nature.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.Nagarajan [Syncfusion]
Replied On May 11, 2007 08:01 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;