Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Scripting
Viewing all articles
Browse latest Browse all 12244

How do I open Camera Raw in Photoshop using COM interop

$
0
0

Given the following code I get an COM error message saying:

 

"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Additional information: Cannot open the file because the open options are incorrect"

 

I cannot see how it is wrong, can someone clarify it for me?

 

BR

Thomas Moltzen-Bildsøe

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Photoshop;

class Program
    {        static void Main(string[] args)        {            PhotoshopApp myBot = new PhotoshopApp();            myBot.loadFile();        }     }    public class PhotoshopApp    {        private Application PSDapp;        public PhotoshopApp()        {            PSDapp = new Application();        }        public void loadFile()        {            CameraRAWOpenOptions raw = new CameraRAWOpenOptions();            raw.Contrast = 1;            raw.Exposure = 0.5;                       String myFile = @"c:\Users\thbd\Documents\Visual Studio 2015\Projects\fremkaldPS\fremkaldPS\tilmelding.png";            PSDapp.DisplayDialogs = PsDialogModes.psDisplayNoDialogs;            PSDapp.Open(myFile, raw, false);        }
 }

Viewing all articles
Browse latest Browse all 12244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>