Hi Domenico,
Thanks for your interest in Syncfusion products.
Currently there is no option
to add background image to a layer. However, you can use the bitmap node and
set the height and width of the bitmap node to height and width of model in
order to look like as a background image of that layer. Please refer the below
code snippet to make a bitmap node look like as a background image of Layer.
Here is the code:
[C#]
Bitmap
bmpBackgrnd = new Bitmap(@"..//..//main_floor_plan.jpg");
BitmapNode
bmpNode = new BitmapNode(bmpBackgrnd,
new RectangleF(0,
0, diagram1.Model.DocumentSize.Width, diagram1.Model.DocumentSize.Height));
bmpNode.PinPointOffset = new SizeF(0, 0);
bmpNode.PinPoint = new PointF(0, 0);
bmpNode.EditStyle.AllowSelect = false;
diagram1.Model.AppendChild(bmpNode);
lyr.Add(bmpNode);
Here is the sample:
https://s3.amazonaws.com/files2.syncfusion.com/dtSupport/DirectTrac/99568/F105393-1867219536.zip
Please let us know if you have any queries.
Regards,
Amsath Ali. M
Hi
Domenico,
Thanks
for your interest in Syncfusion products.
Currently there is no option to add background image to a
layer. However, you can use the bitmap node and set the height and width of the
bitmap node to height and width of model in order to look like as a background
image of that layer. Please refer the below code snippet to make a bitmap node
look like as a background image of Layer.
Here is the code:
[C#]
Bitmap bmpBackgrnd = new Bitmap(@"..//..//main_floor_plan.jpg");
BitmapNode bmpNode = new BitmapNode(bmpBackgrnd, new RectangleF(0, 0,
diagram1.Model.DocumentSize.Width, diagram1.Model.DocumentSize.Height));
bmpNode.PinPointOffset = new SizeF(0, 0);
bmpNode.PinPoint = new PointF(0, 0);
bmpNode.EditStyle.AllowSelect = false;
diagram1.Model.AppendChild(bmpNode);
lyr.Add(bmpNode);
Here is the sample:
https://s3.amazonaws.com/files2.syncfusion.com/dtSupport/DirectTrac/99568/F105393-1867219536.zip
Please
let us know if you have any queries.
Regards,
Amsath
Ali. M