|
Group: Forum Members
Posts: 12,
Visits: 1
|
It doesn't help at all. Let me be more clear: I use layers and I draw shapes in layers accordingly to my needs. The problem is that i don't know how to add a background to a layer and this background cover all the document size.
Right now i use the following piece of code to add background to a layer:
private NLayer CreateNewLayer(NDrawingDocument document) { this.currentLayerNumber = this.currentLayerNumber + 1; NLayer newLayer = new NLayer(); newLayer.Name = "Layer " + this.currentLayerNumber.ToString(); newLayer.Style.StrokeStyle = new NStrokeStyle(1, Color.FromArgb(0xaa, 0x00, 0x00)); newLayer.Style.FillStyle = new NColorFillStyle(Color.FromArgb(0xff, 0x99, 0x77)); newLayer.Style.ShadowStyle = new NShadowStyle(ShadowType.None, Color.Black, new NPointL(3, 3));
NImageFillStyle imageFrameStyle = new NImageFillStyle("floorplan.jpg"); imageFrameStyle.TextureMappingStyle.MapMode = MapMode.RelativeToViewer; newLayer.Style.FillStyle = imageFrameStyle; //this.hasBackground = true;
// add it to the document and make it the active one document.Layers.AddChild(newLayer); document.ActiveLayerUniqueId = newLayer.UniqueId;
// add a rectangle NRectangleShape shape = new NRectangleShape(currentLayerNumber * 11, 1, 10, 10); shape.Style.TextStyle = new NTextStyle(new Font("Ariel", 100), Color.FromArgb(150, 150, 150)); shape.Text = currentLayerNumber.ToString(); document.ActiveLayer.AddChild(shape);
document.RefreshAllViews();
return newLayer; }
But the result is that the background image is only shown in the shape area like in the image bellow:
http://ygo.ro/images/wrong.jpg
|