Пример #1
0
        public static void CreateSolidColorFillLayer(string layer_name, int red, int green, int blue)
        {
            // Desc4
            var Desc4 = PSX.CreateDescriptorForRGBColor(red, green, blue);

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

            Desc3.PutObject((int)con.phKeyColor, (int)con.phClassRGBColor, Desc4);

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

            Desc2.PutString((int)con.phKeyName, layer_name);
            Desc2.PutObject((int)con.phKeyType, PSX.StrToID("solidColorLayer"), Desc3);

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

            Ref1.PutClass(PSX.StrToID("contentLayer"));

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

            Desc1.PutReference((int)con.phKeyNull, Ref1);
            Desc1.PutObject((int)con.phKeyUsing, PSX.StrToID("contentLayer"), Desc2);

            // Play the event in photoshop
            PSX.PlayEvent((int)con.phEventMake, Desc1, (int)con.phDialogSilent, PSX.PlayBehavior.checkresult);
        }
Пример #2
0
        static public PhotoshopTypeLibrary.IActionDescriptor CreateColorStop(System.Drawing.Color c, int location, int midpoint)
        {
            var Desc5 = PSX.MakeNewDescriptor();

            Desc5.PutObject((int)con.phKeyColor, (int)con.phClassRGBColor, PSX.CreateDescriptorForRGBColor(c));
            Desc5.PutEnumerated((int)con.phKeyType, (int)con.phTypeColorStopType, (int)con.phEnumUserStop);
            Desc5.PutInteger((int)con.phKeyLocation, location);
            Desc5.PutInteger((int)con.phKeyMidpoint, midpoint);
            return(Desc5);
        }