Jump to content

Koro

Newbies
  • Posts

    3
  • Joined

  • Last visited

Koro's Achievements

Newbie

Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

0

Reputation

  1. Now tell me how to remove my details from your site and I won't pester you any further. Cheers Koro
  2. Good morning EER, Thanks for putting my query in the right place. This is my 1st post on this this site so I wasn't really sure where to put it and I thought that someone might sort it out -- which you have done and for which I am grateful. Thanks also for your observation. It makes sense but I thought there might be someone out there who could say "You need a reference to this-or-that DLL and if you don't have it you can down load it here...". BTW for what I'm doing PDN has been invaluable. Nice piece of work. Well done. Light years beyond Paint. The downside is that since I'm (at least potentially) creating shipping lanes that connect every port on the planet to every other port, I absolutely must have programmatic way of managing the layers without 'hand' intervention or I'm going to spend the rest of my life drawing lines on bitmaps, saving, exporting, importing... you get the idea. Not a very enticing prospect, I'm sure you would agree. Thanks again, Koro
  3. Good morning everyone, I am using Paint.NET v3.5.8 (Final Release build 3.58.4081.24580) I have a number of PDN files which are geographic maps. They define the locations of maritime shipping lanes. A large number of shipping lanes are defined in this way and each lane is defined on a separate layer. In practice this means that I have a large number of PDN files each of which has a large number of layers. Other processes that are not connected/associated with Paint.Net derive their location data from these individual layers when they are saved as .BMP files. I have downloaded LayerSaver which works as intended but I end up with a large, unstructured collection of BMP files. I am developing a mechanism (a C# app) for making layers more directly available to code which uses the lane definition created in Paint.Net. But things have come unstuck right at the beginning. The code file which sets this up follows. In summary, there is a serialization problem. I am not sure what I'm missing. The substantive code (the two lines in SaveLayers()) is extracted from LayerSaver source code. The LayerSaver executable works just fine so it appears that I'm not declaring something that I need. Any ideas anyone? The complete (I hope) information follows. Cheers, Koro These PaintDotNet DLLs are included in the References list: Interop.WIA PaintDotNet.Base PaintDotNet.Core PaintDotNet.Data which also includes: System System.Data System.Drawing System.Windows.Forms System.Xml Entire code (.cs) file is: namespace LayerManager.PdnFile { #region REFERENCE/ALIAS LIST ///REFERENCES using System; using System.Collections; using System.Text; using System.IO; using PaintDotNet; using PaintDotNet.IO; ///ALIAS LIST using PDN_DOCUMENT = PaintDotNet.Document; #endregion ///_________________________________________________________________________________ public class Class { private string _FileName; ///_____________________________________________________________________________ public Class(string file_name) { _FileName = file_name; } ///_____________________________________________________________________________ public void SaveLayers() { ///_FileName points to a multi-layer .pdn file. ///This line succeeds ... but ... FileStream fs = new FileStream( _FileName, FileMode.Open, FileAccess.Read ); ///... this line fails PDN_DOCUMENT pdn_document = PDN_DOCUMENT.FromStream( fs ); /* The preceding line fails with: A first chance exception of type 'System.Runtime.Serialization.SerializationException' occurred in PaintDotNet.Core.dll System.Runtime.Serialization.SerializationException was unhandled Message="Exception thrown by worker thread" Source="PaintDotNet.Core" Stack msgs that refer to Paint.Net code are: StackTrace: at PaintDotNet.MemoryBlock.PaintDotNet.IDeferredSerializable.FinishDeserialization(Stream input, DeferredFormatter context) in D:\src\pdn\pdn_35x\src\Core\MemoryBlock.cs:line 928 at PaintDotNet.DeferredFormatter.FinishDeserialization(Stream input) in D:\src\pdn\pdn_35x\src\Core\DeferredFormatter.cs:line 116 at PaintDotNet.Document.FromStream(Stream stream) in D:\src\pdn\pdn_35x\src\Data\Document.cs:line 1490 */ } } }
×
×
  • Create New...