Jump to content

Jigsaw Puzzle v2.0 Test


toe_head2001

Recommended Posts

UPDATE: Jigsaw Puzzle v2.0 has been published.

http://forums.getpaint.net/index.php?showtopic=32391
 

... Is it possible to make the corner and edge pieces look like real corner and edge pieces ...

 
This is just a test to get feedback. I whipped this up in CodeLab today. The final release will be properly named and put in the correct submenu.
To better ensure that you remember to delete the .dll later, I've given it an obnoxious name, and didn't put it in a submenu. :P
 
Using square puzzle pieces, it will calculate maximum size the whole puzzle can be, and draw the puzzle lines accordingly. It will also delete all pixels outside the puzzle border.
 
Just like original plugin 1.00x scale equals a 100px square puzzle piece.
 
I made scale size max out at 5x, rather than 10x.  5x (500px) seems sufficient.
 
Defaults to Transparency, rather than Color.
 
The puzzle will be in the center of the canvas. I plan to add a control to move it, but I didn't remember about it until writing this sentence. :P
 
I left the debug info in the UI, but that will of course not be in the final release.
 
The puzzle shape is different from before (this one was faster to code / less code). I can add the other shape (as an option) if people want it.
There are four puzzle patterns available. Defaults the same pattern as v1.0. Anyone have suggestion for the pattern descriptions/names?
 
before2.png
 
after2.png

Edited by toe_head2001

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Hello toe_head2001,

 

Some feedback: 

I like the idea of having several :) interlocking shapes.

Moving the puzzle around will be great too.
 

I made a duplicate of a puzzle and changed color to red. Did some flipping and noticed that some locking edges do not align:

interlocking-4d8b926.png

I did get this error, while testing on a large canvas (3200x2400 at 300ppi). It is perhaps my old PC.
 
 
[File: C:\Program Files\Paint.NET\Effects\puzzle2.dll
      Name: puzzle2Effect.puzzle2EffectPlugin
      Version: 1.9.5805.35670
      Author: Copyright © toe_head2001
      Copyright: Puzzle 2 Test selected pixels
      Website: http://www.getpaint.net/redirect/plugins.html
      Full error message: PaintDotNet.WorkerThreadException: Worker thread threw an exception ---> System.ArgumentException: Parameter is not valid.
   at System.Drawing.Bitmap..ctor(Int32 width, Int32 height, PixelFormat format)
   at puzzle2Effect.puzzle2EffectPlugin.Render(Surface dst, Surface src, Rectangle rect)
   at puzzle2Effect.puzzle2EffectPlugin.OnRender(Rectangle[] rois, Int32 startIndex, Int32 length)
   at PaintDotNet.Effects.Effect`1.Render(Rectangle[] renderRects, Int32 startIndex, Int32 length) in d:\src\pdn\paintdotnet\src\Effects\Effect`1.cs:line 54
   at PaintDotNet.Effects.Effect`1.Render(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, Int32 startIndex, Int32 length) in d:\src\pdn\paintdotnet\src\Effects\Effect`1.cs:line 97
   at PaintDotNet.Effects.BackgroundEffectRenderer.RenderWithClipMask(Effect effect, EffectConfigToken token, RenderArgs dstArgs, RenderArgs srcArgs, Rectangle[] rois, IRenderer`1 clipMaskRenderer) in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 161
   at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderTile(EffectConfigToken token, Int32 tileIndex) in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 141
   at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RenderNextTile(EffectConfigToken token) in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 134
   at PaintDotNet.Effects.BackgroundEffectRenderer.RendererContext.RendererLoop(EffectConfigToken token) in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 106
   --- End of inner exception stack trace ---
   at PaintDotNet.Effects.BackgroundEffectRenderer.DrainExceptions() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 431
   at PaintDotNet.Effects.BackgroundEffectRenderer.Join() in d:\src\pdn\paintdotnet\src\PaintDotNet\Effects\BackgroundEffectRenderer.cs:line 422
   at PaintDotNet.Menus.EffectMenuBase.DoEffect(Effect effect, EffectConfigToken token, PdnRegion selectedRegion, PdnRegion regionToRender, IRenderer`1 clipMaskRenderer, Surface originalSurface, Exception& exception) in d:\src\pdn\paintdotnet\src\PaintDotNet\Menus\EffectMenuBase.cs:line 1527]

Link to comment
Share on other sites

I made a duplicate of a puzzle and changed color to red. Did some flipping and noticed that some locking edges do not align:

 

I'll take a look at the line curve coordinates. However, I doubt they'll ever be pixel perfect, due to the nature of the calculations (rounding to whole numbers). Basically the coordinates are hardcoded values that are multiplied by the scale.

Simplified example: Say point2 has the "X, Y" coordinates of (5, 10). Using a scale of 1.50x would give you (7.5, 15). But the paint.net canvas uses whole numbers, so you end up with (7, 15). (The calculation in the effect is not that simple; just an example)

In practice, less than 1 pixel is not noticeable, but I'm just saying. ;)

 

 

I did get this error, while testing on a large canvas (3200x2400 at 300ppi). It is perhaps my old PC.

 

Yeah... the code to create the bitmap (among other things) is being executed many times, instead of just once. Good way to eat up system memory. That is the only way CodeLab allows it, but I'll be moving it into Visual Studio before the final release, which gives more flexibility.

 

 

I like the idea of having several :) interlocking shapes.

 

Would you like the old puzzle pattern as an option? I may add it anyways, just because I don't like "removing" features. I'm not sure yet.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Sweet, It will have to be later today to try out. :(

 

My dad had puzzles from when he was a boy, alas now lost to the ages. None of the pieces had tabs like today's puzzles, just curved edges. A few of the inner pieces were cut around various characters in the scene, like the doggy, a little boy and  the cottage.

 

Just a remembrance, not a suggestion. :)

 



 

SloppySig.png

Link to comment
Share on other sites

My dad had puzzles from when he was a boy, alas now lost to the ages. None of the pieces had tabs like today's puzzles, just curved edges. A few of the inner pieces were cut around various characters in the scene, like the doggy, a little boy and  the cottage.

 

My family has (had?) an old wooden puzzle like that.

 

 

Can you make something that cuts them apart?   :D

 

I'm not sure what you mean by this. Please elaborate.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

Posted a new build.

It now has alternative puzzle patterns. Does anyone suggestions for pattern descriptions/names?
The Offsets are now adjustable.
The locking edges should now align when flipped.

See first post for download.

(September 25th, 2023)  Sorry about any broken images in my posts. I am aware of the issue.

bp-sig.png
My Gallery  |  My Plugin Pack

Layman's Guide to CodeLab

Link to comment
Share on other sites

  • toe_head2001 locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...