//Creates a new layer! public void CreateNewLayer() { if (CanvasHeight == 0 || CanvasWidth == 0) { throw new LayerManagerNotInitializedCompletelyException("Canvas height and width not set."); } LayersBox box = new LayersBox(); Layer lay = new Layer(LayerCount, CreateInitialPixelLayer(CanvasHeight, CanvasWidth, DefaultPixelSize, true), new Size(CanvasWidth, CanvasHeight), DefaultPixelSize); lay.name = "Layer " + LayerCount; box.AddLayerInfo(lay); AddLayer(box); }
//Creates transparent backdrop public void RenderInitialCanvas() { Layer layer0 = new Layer(0, CreateInitialPixelLayer(CanvasHeight, CanvasWidth, DefaultPixelSize, false), new Size(CanvasHeight, CanvasWidth), DefaultPixelSize); layer0.SetActive(true); layer0.name = "Background"; Visibility = Visibility.Visible; LayersBox box0 = new LayersBox(true); box0.AddLayerInfo(layer0); AddLayer(box0); CreateNewLayer(); SetCanvasSize((int)layer0.Height, (int)layer0.Width); }
public void AddLayerInfo(Layer layer) { layerInfo = layer; ChangeName(layerInfo.name); layer.ActiveChanged += Layer_ActiveChanged; }