public PhotoshopProxy()
        {
            /*
             * Ensure that the static members are initialized correctly
             *
             * */

            m_app2        = new Application();
            m_app         = new PhotoshopTypeLibrary.PhotoshopApplication();
            m_app.Visible = 1;

            m_control = m_app.MakeControlObject();

            //WORKITEM: throw exception if either of these are null
        }
Beispiel #2
0
        static public void Initialize()
        {
            if (Process.GetProcessesByName("Photoshop").Length > 0)
            {
                App = new Photoshop.Application();

                var refApp = new ActionReference();
                refApp.PutProperty(App.StringIDToTypeID("property"), App.StringIDToTypeID("tool"));
                refApp.PutEnumerated(App.StringIDToTypeID("application"), App.StringIDToTypeID("ordinal"), App.StringIDToTypeID("targetEnum"));

                AppDescriptor = App.ExecuteActionGet(refApp);

                var refDoc = new ActionReference();

                refDoc.PutProperty(App.StringIDToTypeID("property"), App.StringIDToTypeID("zoom"));
                refDoc.PutEnumerated(App.StringIDToTypeID("document"), App.StringIDToTypeID("ordinal"), App.StringIDToTypeID("targetEnum"));

                DocumentDescriptor = App.ExecuteActionGet(refDoc);
            }
            else
            {
                App = null;
            }
        }