コード例 #1
0
        public static void DeleteLayer(int layer_index)
        {
            // Ref1
            PhotoshopTypeLibrary.IActionReference Ref1 = LayerAPI.GetReferenceToLayerByIndex(layer_index);

            // Desc1
            PhotoshopTypeLibrary.IActionDescriptor Desc1 = PSX.MakeNewDescriptor();

            Desc1.PutReference((int)con.phKeyNull, Ref1);

            // Play the event in photoshop
            PSX.PlayEvent((int)con.phEventDelete, Desc1, (int)con.phDialogSilent, PSX.PlayBehavior.checkresult);
        }
コード例 #2
0
        public static Object get_value_from_object(int obj_classid, int object_index, int prop_id)
        {
            /*
             * Returns an Object that represents the value in the descriptor.
             *
             * obj_id - id for object to get prop from
             * prop_id - id for prop value to get
             * index - (-1) = use current object, else use the object at the given index
             */

            PhotoshopTypeLibrary.IActionReference  ref1 = get_reference_to_object_property_by_index(obj_classid, object_index, prop_id);
            PhotoshopTypeLibrary.IActionDescriptor result;
            m_control.GetActionProperty(ref1, out result);

            Object retval = get_value_from_descriptor(result, prop_id);

            return(retval);
        }
コード例 #3
0
        // A list of all the document properties for easy eumeration

        public static PhotoshopTypeLibrary.IActionReference GetReferenceToLayerByIndex(int layer_index)
        {
            PhotoshopTypeLibrary.IActionReference Ref1 = PSX.get_reference_to_object((int)con.phClassLayer, layer_index);
            return(Ref1);
        }