Jump to content
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

Hi I'm new to Paint.net but it does seem to be an excellent program. There is a plugin to enable RAW files to be loaded (Rawloader) but the default compiled code does not include support for Pentax .pef files although the converter that it uses (DCRAW) does.

Others have mentioned being able to use Visual Studio c# Express to modify the file open dialog to enable .pef files to be converted.

I'm an experienced VBA/VBScript programmer and have a vague awareness of c derivate program languages but this is first time I've wanted to do something in earnest with a c# program.

My slghtly modified copy of the source code is shown below However when I try to build the project I get an error as follows:

Error 1 'PaintDotNet.FileType.FileType(string, bool, bool, bool, bool, bool, string[])' is obsolete: 'Use the FileType(string, FileTypeFlags, string[]) overload instead' C:\Downloads\PhotoEditing\RawLoaderSource\RawLoader\RawLoader.cs 21 10 RawLoader

All I've done is add the .pef extension into the line commented //extensions. Can anyone help me understand why it won't compile even though I had understood it was originally compiled with the same c# compiler.

Many thanks - Neil

****************Source Code*****************************

using System;

using System.IO;

using System.Configuration;

using System.Windows.Forms;

using PaintDotNet;

namespace RawLoader

{

public class RAWFileTypes : IFileTypeFactory

{

public static readonly FileType Raw = new RawFileType();

private static FileType[] fileTypes = new FileType[] { Raw };

public FileType[] GetFileTypeInstances()

{

return (FileType[])fileTypes.Clone();

}

}

public class RawFileType : FileType

{

private String runpath, arguments;

public RawFileType() : base( "Raw Camera Images",

false, // does not support layers

false, // does not support custom headers

false, // does support saving

true, // does support loading

false, // does not save with progress

new string[] { ".pef", ".dng", ".nef", ".crw", ".cr2", ".mrw", ".raf", ".x3f", ".orf", ".raw" } ) // extensions

{

}

protected override Document OnLoad(System.IO.Stream input)

{

MemoryStream TiffStream = new MemoryStream();

// Load Settings

runpath = ConfigurationManager.AppSettings["path"];

if (runpath == null) runpath = "dcraw.exe";

arguments = ConfigurationManager.AppSettings["arguments"];

if (arguments == null) arguments = "-w -q 3 -n 3";

// Write Stream to temporary file

using (TempFile RawFile = new TempFile())

{

RawFile.WriteStream(input);

// Run DCRaw and capture its StandardOutput into temporary Tiff memory stream

ProcessOutput DCRaw = new ProcessOutput(runpath, arguments + " -c -T \"" + RawFile.Path + "\"");

StreamUtils.ReadWriteStream(DCRaw.Stream,TiffStream);

DCRaw.WaitForExit();

}

// Use default Tiff loader to load from Tiff memory stream

TiffStream.Position = 0;

FileType TiffHandler = PdnFileTypes.Tiff;

return TiffHandler.Load(TiffStream);

}

}

}

The Sky is a Beautiful Place

Sig2.jpg

Posted

Help yourself, change your thread title.

About your problem, I don't think just adding the extension will do the trick.

No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio

Guest
This topic is now closed to further replies.
×
×
  • Create New...