Ejemplo n.º 1
0
        public static void CreateLayer(string layer_name)
        {
            PSX.CheckStringContents(layer_name);

            // Desc2
            var Desc2 = PSX.MakeNewDescriptor();

            Desc2.PutString((int)con.phKeyName, layer_name);

            // Ref1
            var Ref1 = PSX.MakeNewReference();

            Ref1.PutClass((int)con.phClassLayer);

            // Desc1
            var Desc1 = PSX.MakeNewDescriptor();

            Desc1.PutReference((int)con.phKeyNull, Ref1);
            Desc1.PutBoolean(PSX.StrToID("below"), PSX.FALSE);
            Desc1.PutObject((int)con.phKeyUsing, (int)con.phClassLayer, Desc2);

            int old_layer_count = LayerAPI.GetLayerCount(-1);

            // Play the event in photoshop
            PSX.PlayEvent((int)con.phEventMake, Desc1, (int)con.phDialogSilent, PSX.PlayBehavior.checkresult);

            LayerAPI.CheckLayerCount(-1, old_layer_count + 1);
        }