Jump to content

pworm

Newbies
  • Posts

    3
  • Joined

  • Last visited

Everything posted by pworm

  1. Ok, thanks for your replys. Actually I am not a coder except some very basic Java knowledge. But I managed it to create a functional Filetype plugin. I have no idea, if it is good coding style but at least it is working for me and I'd like to share this here - just in case someone is having a similar problem. My code is based on a project template created by toe_head2001 - thanks man, that helped a lot: using PaintDotNet; using System.IO; using System.Drawing; namespace RoHoFileTypePlugin2 { public sealed class RoHoFileTypePlugin2Factory : IFileTypeFactory { public FileType[] GetFileTypeInstances() { return new[] { new RoHoFileTypePlugin2Plugin() }; } } [PluginSupportInfo(typeof(PluginSupportInfo))] internal class RoHoFileTypePlugin2Plugin : FileType { // Constructs a ExamplePropertyBasedFileType instance internal RoHoFileTypePlugin2Plugin() : base( "MyFileType", new FileTypeOptions { LoadExtensions = new string[] { ".1", ".2" }, }) { } /// <summary> /// Creates a document from a stream /// </summary> protected override Document OnLoad(Stream input) { Image image = Image.FromStream(input, true); return Document.FromImage(image); } } }
  2. In my case it is 'impossible'. These files are opened from a read-only device and it is strictly forbidden to copy/save any of this data on the local storage. This is why I stated 'impossible'. What I didn't know & I don't understand is, why Paint.Net refuses to open the files just because of an invalid file-extension. Even the Windows Imageviewer doesn't care about the file-extension and opens any file. Never the less it would be great if anyone could point out a solution besides renaming the file. Is it somehow possible to tell Paint.Net that .1 / .2 is a know image type?
  3. Hi, is there a possibility to open image-files in TIFF format, which have "invalid"-fileextensions? All my files are double sided scans with fileextension file.1 (first side) and file.2 (second page). It is impossible to copy and/or rename these files. How can I make Paint.Net to accept *.1 and *.2 files as valid image-files? Thanks in advance & best wishes, Heiko
×
×
  • Create New...