Hi.
My name is Riccardo Esercitato and I am experimenting with DIAGRAM control and VB and ASP.NET.
Imports Syncfusion.JavaScript.DataVisualization.Models.Diagram
Imports Syncfusion.JavaScript.DataVisualization.DiagramEnums
Imports Syncfusion.JavaScript.DataVisualization.Models
Imports Syncfusion.JavaScript.DataVisualization.Models.Collections
Partial Class MyPage
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
InitDiag()
End If
End Sub
Private Sub InitDiag()
Dim manufacturing As BasicShape = CreateNode("manufacturing", 175, 60, 300, 60, "Manufacturing Tablet PC", "#05ADA4")
manufacturing.Shape = BasicShapes.Path
manufacturing.PathData = "M 269.711,29.3333C 269.711,44.061 257.772,56 243.044,56L 158.058,56C 143.33,56 131.391,44.061 131.391,29.3333L 131.391,29.3333C 131.391,14.6057 143.33,2.66669 158.058,2.66669L 243.044,2.66669C 257.772,2.66669 269.711,14.6057 269.711,29.3333 Z"
Dim immagine As ImageNode = CreateImage("D:\Risorse\Images\RedForest.jpg", 100, 200, 140, 300)
Diagram1.PageSettings.PageWidth = 1100
Diagram1.PageSettings.PageHeight = 1200
Diagram1.PageSettings.ShowPageBreak = False
Diagram1.PageSettings.MultiplePage = False
Diagram1.ShowTooltip = True
Diagram1.Model.Nodes.Add(manufacturing)
Diagram1.Model.Nodes.Add(immagine)
End Sub
Private Function CreateNode(name As String, width As Double, height As Double, offsetx As Double, offsety As Double, labelText As String, fillColor As String) As BasicShape
Dim node As New BasicShape()
With node
.Name = name
.Width = width
.Height = height
.OffsetX = offsetx
.OffsetY = offsety
.FillColor = fillColor
.BorderColor = "#000000"
Dim label As New Syncfusion.JavaScript.DataVisualization.Models.Diagram.Label()
label.Text = labelText
label.FontColor = "white"
label.Name = name + "_label"
.Labels.Add(label)
End With
Return node
End Function
Private Function CreateImage(sPath As String, offsetx As Integer, offsety As Integer, xsize As Integer, ysize As Integer) As ImageNode
Dim node As New ImageNode
With node
.Name = "Img01"
.OffsetX = offsetx
.OffsetY = offsety
.Width = xsize
.Height = ysize
.Source = sPath
End With
Return node
End Function
End Class
As you can see, the image node has been created and correctly dimesioned, but no image appears.
I already tried to change picture path and picture type too (PNG, JPG ...) but nothing changes.
I am wrong somewhere, but I'm not able to discover where... can someone help me, please?