Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation


Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks. I commented-out the 4 errors and compiled it, and then tried it out with Paint.NET v4.2.13. There don't seem to be any obvious (at least to me) issues so far.
  2. Great to see that the file types have been updated. I've just been trying to compile the code with VS2017 targetting .NET 4.8. I have a couple of issues with SvgFileType.cs. Firstly, the obsolete constructor. Have I fixed it correctly? public class SvgFileType : FileType { // // Obsolete. // //public SvgFileType() // : base( // "Scalable Vector Graphics", // name // FileTypeFlags.SupportsLoading, // flags // new[] {".svg", ".svgz"}) // extensions
  3. Hi verdy_p, You can reset the flag in OnSetRenderInfo()
  4. >the dotNet compiler already optimizes integer divisions or multiplications by constant powers of 2 using binary shifts. @verdy_p Thanks for enlightening me. I didn't know that. (The principle is still sound though.) What we need is higher resolutions VDUs, say 600dpi, then we wouldn't need antialiasing at all.
  5. @verdy_p: When multiplying or dividing by 2^n you can use shift left or shift right. The following code snippet: for (y2 *= 2, x2 = (n = e = x2) * 2; n > 0; --n) { becomes: for (y2 <<= 1, x2 = (n = e = x2) << 1; n > 0; --n) { It shaves off more than a few CPU cycles and doesn't use the FPU.
  6. I've tried the following plug-in experiment. It gives inconsistent results, but Loop 2 is usually a bit faster than Loop 1 (the JIT compiler has done its job well). The Windows Forms experiment gave a consistent and marked speed difference. So why the difference? Hidden Content: using System.Diagnostics; using System.Drawing; using System.Windows.Forms; using PaintDotNet; using PaintDotNet.Effects; namespace EffectsPluginTemplate1 { public class EffectPlugin : PaintDotNet.Effects.Effect { public static string StaticName { get {
  7. I'm running it by double-clicking on the exe in Windows Explorer.
  8. And when I switch off overflow/underflow checks, Loop 2 runs about six times faster than Loop 1.
  9. I checked optimise code in project properties (Release). Loop 2 runs 3.64 times faster than Loop 1. Here's my ILDASM where Loop 1 uses call instance and Loop 2 uses ldloc.s: Hidden Content: .method private hidebysig instance void buttonLoops_Click(object sender, class [mscorlib]System.EventArgs e) cil managed { .maxstack 5 .locals init ( [0] class [system]System.Diagnostics.Stopwatch sw, [1] valuetype [system.Drawing]System.Drawing.Rectangle rect, [2] string str, [3] int32 y, [4] int32 x, [5] int32 left, [6] int32 right,
  10. A common rendering inefficiency amongst many code samples is caused by the repetitive accessing of properties of the Rectangle class in for-loops in the Render method. Consider the following code sample. The second style is faster because it uses local variables to access the rectangle data. The first style makes repeated subroutine calls to access the rectangle data: Hidden Content: using System.Diagnostics; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { Ini
  11. I've just had another look at that problem. I should have put a lock statement in OnSetRenderInfo(). Thanks for highlighting it.
  12. Yes. Tile height and width of the tessarae can be changed independently using sliders ranging from 2px to 100px. I'll update my original post with a better description. No, but I could add this capability to a future release. Currently the tesserae are drawn on opaque background (it's the Secondary colour with Alpha set to fully opaque 255).
  13. Thanks for your suggestions. I've now published it here (and here) Rounded Corners: Hmmm. That involves calculating eight tangents and four x-y offsets and drawing an arc about each of the four x-y offsets between pairs of tangents. Easy enough to say, but tricky to implement. I'll have a think... EDIT 1: Updated links for new forum.
  14. Hi All, Here's my Rounded Rectangle effect. (A full list of my effects is here.) Rounded Rectangle - Version - 27 February 2017 ┬ęCopyright Tim Mathias 2017. All rights reserved. USE AT YOUR OWN RISK. Menu: Effects -> Render -> Rounded Rectangle... LavEnt.Effects.RoundedRectangle. Example 1 Example 2 The Rounded Rectanlge effect uses the Primary and Secondary colours and the current brush width to draw a rectangle with rounded corners into the current selection. The roundn
  15. Hi All, Here's my Mosaic effect. (A full list of my effects is here.) Mosaic - Version - 27 February 2017 ┬ęCopyright Tim Mathias 2017. All rights reserved. USE AT YOUR OWN RISK. Menu: Effects -> Artistic -> Mosaic... LavEnt.Effects.Mosaic. Before After The Mosaic effect converts a drawing into a mosaic pattern and uses the Secondary colour as the adhesive or grout between the tesserae. Tessera Width: 2px to 100px Tessera Height: 2px to 100px Tessera Colour:
  • Create New...