Sign in to follow this  
Omnicoder

Save as .PDN outside Paint.net

Recommended Posts

I have been trying (using vb.net) to allow my (free) application to save pngs as seperate layers in a .pdn file. I've tried importing all of the dll's from paintdotnet's install folder but I got a resource error trying to add an image to a layer.

I tried using files from an old copy of the source and it also didn't work. How do I add pngs to seperate layers and save as pdn?

code I was using to (try) and add an image

Dim g As New PaintDotNet.Document(640, 480)

g = PaintDotNet.Document.FromImage(PictureBox1.Image)

Dim i As New FileStream("C:\users\\desktop\test.pdn", FileMode.OpenOrCreate)

g.SaveToStream(i)

error:

Hidden Content:
System.Resources.MissingManifestResourceException was unhandled

Message="Could not find any resources appropriate for the specified culture (or the neutral culture) on disk. baseName: PaintDotNet.Strings.3 locationInfo: fileName: PaintDotNet.Strings.3.resources"

Source="mscorlib"

StackTrace:

at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at PaintDotNet.PdnResources.GetString(String stringName) at PaintDotNet.Layer.CreateBackgroundLayer(Int32 width, Int32 height) at PaintDotNet.Document.FromImage(Image image) at WinLayers.Form1.Button2_Click(Object sender, EventArgs e) in C:\Users\Alex\Documents\Visual Studio 2008\Projects\WinLayers\WinLayers\Form1.vb:line 11 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at WinLayers.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

InnerException:

Share this post


Link to post
Share on other sites

I have been trying (using vb.net) to allow my (free) application to save pngs as seperate layers in a .pdn file. I've tried importing all of the dll's from paintdotnet's install folder but I got a resource error trying to add an image to a layer.

I tried using files from an old copy of the source and it also didn't work. How do I add pngs to seperate layers and save as pdn?

code I was using to (try) and add an image

Dim g As New PaintDotNet.Document(640, 480)

g = PaintDotNet.Document.FromImage(PictureBox1.Image)

Dim i As New FileStream("C:\users\\desktop\test.pdn", FileMode.OpenOrCreate)

g.SaveToStream(i)

error:

Hidden Content:
System.Resources.MissingManifestResourceException was unhandled

Message="Could not find any resources appropriate for the specified culture (or the neutral culture) on disk. baseName: PaintDotNet.Strings.3 locationInfo: fileName: PaintDotNet.Strings.3.resources"

Source="mscorlib"

StackTrace:

at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) at System.Resources.ResourceManager.GetString(String name, CultureInfo culture) at PaintDotNet.PdnResources.GetString(String stringName) at PaintDotNet.Layer.CreateBackgroundLayer(Int32 width, Int32 height) at PaintDotNet.Document.FromImage(Image image) at WinLayers.Form1.Button2_Click(Object sender, EventArgs e) in C:\Users\Alex\Documents\Visual Studio 2008\Projects\WinLayers\WinLayers\Form1.vb:line 11 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at WinLayers.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

InnerException:

Share this post


Link to post
Share on other sites

The error is because you don't have PaintDotNet.Strings.3.Resources in wherever you're running your program from. You need that.

To add layers to a document, use document.Layers.Add(new BitmapLayer(Surface.CopyFromBitmap(image)))

Share this post


Link to post
Share on other sites

The error is because you don't have PaintDotNet.Strings.3.Resources in wherever you're running your program from. You need that.

To add layers to a document, use document.Layers.Add(new BitmapLayer(Surface.CopyFromBitmap(image)))

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this