Jump to content

jerone

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

237 profile views

jerone's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Yes, this would be very useful for me too. 👍 Now, I usually double the sizes or add another 1000 pixels, just to get enough room. And then later "Crop to Selection" to get the desired size. With this suggestion, it would simplify this process.
  2. Duplicate: http://forums.getpaint.net/index.php?/topic/27984-beta-40-cannot-paste-images-copied-from-firefox/
  3. Having the same issue. Steps to reproduce: Open http://www.getpaint.net into a tab in Firefox. Right-click the image on that page and press "Copy image". Go to Paint.net program and paste the image (Ctrl + v or paste from menu) into a blank canvas. See the error message as above show up. Environment: Firefox 28 & 29 Windows 7 & 8.1 Paint.net 4.0.5168
  4. I have a bug report: I used to copy-paste an image from Firefox into a blank image in Paint.net. But with the latest beta I get an error saying: Steps to reproduce: Open http://www.getpaint.net into a tab in Firefox. Right-click the image on that page and press "Copy image". Go to Paint.net program and paste the image (Ctrl + v or paste from menu) into a blank canvas. See the error message as above show up. Environment: Firefox 28 & 29 Windows 7 & 8.1 Paint.net 4.0.5168 Edit: Just noticed this topic: http://forums.getpaint.net/index.php?/topic/28027-bug-image-copying-from-firefox/
  5. Scroll wheel in Settings window > Tools doesn't work (Diagnostics does). Also, I have one feature request. Can you add a confirm message after opening multiple files (without editing) and pressing the program close button.
  6. Great tool! Keep up the great work. Small bug; when installing I checked the option to check for pre-releases (beta), but when opening the settings window, this option isn't checked. Another small bug; languages dropdown doesn't show current language (see attachment). Does show again when opening dropdown. Steps to reproduce: Open Settings window. Select another tab then "User Interface". Close Settings window. Open Settings window. Select tab "User Interface" and see clear language dropdown. Also, I have one feature request. Can you add a confirm message after opening multiple files (without editing) and pressing the program close button. Specs: paint.net 4.0 alpha build 5086 Windows 7 SP1
  7. Code needs update for VS2012, but is a great start.
  8. Great. Can you add a few setting to prepend the code with the correct base64 syntax "data:image/png;base64,". And maybe an option to build the HTML tag for an image or CSS for background image...
  9. I was just in the progress of building my own (see code below), but yours works great with the extra option for file type. using System; using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Text; using System.Windows.Forms; namespace PaintDotNet.Plugin.FileTypes { /// <summary> /// Base64 file type /// </summary> public class Base64FileType : FileType { #region Constructor; /// <summary> /// Base64 file type /// </summary> public Base64FileType() : base("Base64", FileTypeFlags.SupportsLoading | FileTypeFlags.SupportsSaving, new String[] { ".txt" }) { } #endregion Constructor; #region Override; /// <summary> /// Open file /// </summary> /// <param name="input"></param> /// <returns></returns> protected override Document OnLoad(Stream input) { try { // Convert byte[] string to Base64; StreamReader reader = new StreamReader(input); String base64String = reader.ReadToEnd(); base64String = base64String.Replace("data:image/png;base64,", ""); // Convert Base64 string to byte[]; byte[] imageBytes = Convert.FromBase64String(base64String); MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length); // Convert byte[] to Image; ms.Write(imageBytes, 0, imageBytes.Length); Image image = Image.FromStream(ms, true); return Document.FromImage(image); } catch { MessageBox.Show("Problem Importing File"); Bitmap b = new Bitmap(500, 500); return Document.FromImage(; } } /// <summary> /// Save file /// </summary> /// <param name="input"></param> /// <param name="output"></param> /// <param name="token"></param> /// <param name="scratchSurface"></param> /// <param name="callback"></param> protected override void OnSave(Document input, Stream output, SaveConfigToken token, Surface scratchSurface, ProgressEventHandler callback) { RenderArgs ra = new RenderArgs(new Surface(input.Size)); input.Render(ra, true); using (MemoryStream ms = new MemoryStream()) { // Convert Image to byte[]; ra.Bitmap.Save(ms, ImageFormat.Gif); Byte[] imageBytes = ms.ToArray(); // Convert byte[] to Base64 string; String base64String = "data:image/png;base64," + Convert.ToBase64String(imageBytes); // Convert Base64 string to byte[]; ASCIIEncoding encoding = new ASCIIEncoding(); Byte[] stringBytes = encoding.GetBytes(base64String); // Save to stream; output.Write(stringBytes, 0, stringBytes.Length); } } #endregion Override; } public class Base64FileTypeFactory : IFileTypeFactory { public FileType[] GetFileTypeInstances() { return new FileType[] { new Base64FileType() }; } } }
  10. So this is possible with plugins? Can you point me in the right direction for documentation about how I can make a save-as plugin, and I mite have a go myself...
  11. I was wondering if it's possible to save an image as Base64 string? Maybe as a plugin?
×
×
  • Create New...