Open a raw file using C#

Photoshop Script Snippets - Note: Full Scripts go in the Photoshop Scripts Forum

Moderators: Tom, Kukurykus

Paul MR

Open a raw file using C#

Post by Paul MR »

Example of opening a raw file using C#

Add Reference for Photoshop.

Code: Select allusing System;
using ps = Photoshop;

namespace OpenRawFile
{
    class Program
    {
       
        static void Main(string[] args)
        {
            ps.ApplicationClass app = new ps.ApplicationClass();
            app.DisplayDialogs = Photoshop.PsDialogModes.psDisplayNoDialogs;
            var RAWOpenOptionsRef = new ps.CameraRAWOpenOptionsClass();
            RAWOpenOptionsRef.Contrast = 1;
            RAWOpenOptionsRef.Exposure = 0.5;
            String myFile = "c://temp//P1.RW2";
            app.Open(myFile, RAWOpenOptionsRef, false);//true = Smart Object

        }
    }
}