Ejemplo n.º 1
0
        public override bool Execute()
        {
            // Fix me, this is an ugly construction
              Layer layer = new Layer(ActiveDrawable);
              if (!layer.HasAlpha)
            {
              layer.AddAlpha();
            }
              Mask mask = layer.CreateMask(AddMaskType.White);
              layer.Mask = mask;
              ActiveDrawable = mask;

              return true;
        }
Ejemplo n.º 2
0
        override public bool Execute()
        {
            // Fix me, this is an ugly construction
            var layer = new Layer(ActiveDrawable);

            if (!layer.HasAlpha)
            {
                layer.AddAlpha();
            }
            var mask = layer.CreateMask(AddMaskType.White);

            layer.Mask     = mask;
            ActiveDrawable = mask;

            return(true);
        }
Ejemplo n.º 3
0
        Layer AddLayer(Image image, int layerNr, string name,
                       string translate_x, string translate_y,
                       out PixelRgn destPR)
        {
            destPR = null;
            int keepLayer = GetValue <int>("keep_layer");

            if (keepLayer == 0 || keepLayer == layerNr)
            {
                var layer = new Layer(image, name, ImageType.Rgba);
                layer.Translate(GetValue <int>(translate_x), GetValue <int>(translate_y));
                layer.AddAlpha();
                image.InsertLayer(layer, 0);

                destPR = new PixelRgn(layer, image.Bounds, true, false);
                return(layer);
            }
            return(null);
        }
Ejemplo n.º 4
0
        Layer AddLayer(Image image, int layerNr, string name, 
		   string translate_x, string translate_y, 
		   out PixelRgn destPR)
        {
            destPR = null;
              int keepLayer = GetValue<int>("keep_layer");
              if (keepLayer == 0 || keepLayer == layerNr)
            {
              var layer = new Layer(image, name, ImageType.Rgba);
              layer.Translate(GetValue<int>(translate_x), GetValue<int>(translate_y));
              layer.AddAlpha();
              image.InsertLayer(layer, 0);

              destPR = new PixelRgn(layer, image.Bounds, true, false);
              return layer;
            }
              return null;
        }