Applies to: Nevron Diagram for .NET

How to display images in the diagram?

It is possible to create a shape that contains a bitmap image (or any raster image). All shapes can be filled with a texture. The following code demonstrates how to apply a texture (image fill style) to a rectangle primitive:

[C#]

NRectangleShape rect = new NRectangleShape(0, 0, 100, 100);
rect.Style = new NStyle();
rect.Style.FillStyle = new NImageFillStyle("c:\\Temp\\SomeImage.bmp");
nDrawingDocument1.ActiveLayer.AddChild(rect);

[VB.NET]
Dim rect As New NRectangleShape(0, 0, 100, 100)
rect.Style = New NStyle()
rect.Style.FillStyle = New NImageFillStyle("c:\Temp\SomeImage.bmp")
nDrawingDocument1.ActiveLayer.AddChild(rect)



For more detailed information about appearance and fill styles, take a look at the following documentation topics:

Diagram for .NET > User's Guide > Document Object Model > Styles, Style Composition and Style Sheets
Framework > Presentation Layer > Graphics > Appearance Styles > Appearance Styles Overview
Framework > Presentation Layer > Graphics > Appearance Styles > Fill Styles > Fill Styles Overview
Framework > Presentation Layer > Graphics > Appearance Styles > Fill Styles > Image Fill Style

Article ID: 12, Created On: 9/29/2010, Modified: 2/28/2012