Sign in to follow this  
DataDink

Tile

Recommended Posts

Tile

 

Source: https://github.com/DataDink/DinkPDN#tile

Download: Removed for now -- see below, -Rick

Developed on: PDN 4.0.6, NET 4.5.2, WIN 10

 

TLDR: This takes the current image, selection, clipboard image, or externally loaded image and tiles it.

 

Usage:

  • Select the area you want to tile across (or don't)
  • Effects -> Fill -> Tile
  • Adjust stuff

 

004.jpg

 

Options:

  • Horizontal Scale: This will adjust the width of the tile. Set this to 0 to keep it proportionately scaled with the Vertical Scale.
  • Vertical Scale: This will adjust the height of the tile. Set this to 0 to keep it proportionately scaled with the Horizontal Scale.
  • Horizontal Offset: This will cause the horizontal starting point of the tile to be offset from the left edge of the region.
  • Vertical Offset: This will cause the vertical starting point of the tile to be offset from the top edge of the region.
  • From Clipboard: This will create tiles using the image in the clipboard if any.
  • From File: This will allow you to load an externally saved image to tile.

 

Known Issues:

  • This currently only works with rectangular selections/regions (Fixed)
  • Very small and unlikely memory leak identified.

Notes:

This has similar functionality to existing plugins. 

Please feel free to contribute, fix, or fork this project here: https://github.com/DataDink/DinkPDN

post-145003-0-23935300-1453528841_thumb.

Edited by Rick Brewster
  • Upvote 2

Share this post


Link to post
Share on other sites

It's interesting how you customized/extended IndirectUI like that (I learned something new), but I'm not sure Rick wants things like that published on this forum. I could be wrong.

Share this post


Link to post
Share on other sites

Thanks for the effect and the effort DataDink,

 

When you say "This currently only works with rectangular selections/regions" Do you mean that, perhaps, in the future, it will be possible to tile other shapes. For example, the possibility to tile an hexagone. I really would like this feature. 

hexagone-tiled-4e2e0c1.png

Share this post


Link to post
Share on other sites

What I meant by that was if you have a circle area selected you will end up with a square area that gets rendered. It wasn't until right as I was posting this that I thought about it but it shouldn't be a difficult fix.

 

What you're suggesting is different though. This would require some kind of configuration to stagger the "row" or "column". So I'm thinking about what that would translate to configuration-wise.

Maybe just be a checkbox to make a 50% alternating offset ? Can you think of a use-case where someone would want quarter/variable offsets (0%, 25%, 50%, 75%, etc)?

 

The only concern I ever have is over-complicating the primary use-case of the plugin to accommodate edge-cases. It can lead to a frustrating experience 99% of the time to solve issues that only show up 1% of the time. Not that an extra checkbox would cause this to happen, you just have to stay vigilant because each little thing can add up quickly.

 

 

Edit: Actually no, that wouldn't work - you would also have to adjust the row or column size to fit those pieces together. Another way to tackle that problem would be maybe a "radial tile" plugin that would let you configure iterations "around" rather than side-by-side. That might be a better solution maybe? What think you?

Edited by DataDink

Share this post


Link to post
Share on other sites

Hello. Thank you for the plugin! :)
 
I like this plugin. It's super easy to use with an easy to understand UI. I found this plugin a little better to work with compared to other tiling features/plugins I've tried to play around with before.

I like the idea of keeping this plugin simple, but I also like the idea of this plugin expanding to do more. Perhaps this could be a simple version and then you could make an "Advanced" version? For some people, the more a plugin does the more intimidating it is, for other people, the more a plugin can do, the more awesome it is. The problem is, keeping a plugin user friendly becomes difficult when it has the ability to do many things. However, I think I like the idea of a plugin being able to do tiling of different shapes, so perhaps a drop down menu could allow that?
 
 
Now then, aside from talking about the potential of this plugin, I do actually have a very small glitch to report.
There is a small visual glitch with the UI for me. The bottom of the clipboard check box is mildly cutoff. It's not that big of a deal, but I thought I would mention it.

I am using windows 7  32bit.
And I have my display/DPI setting set to 125% (I mention my display/DPI because it seems to be the issue with other plugins too).

 

 

Tile_Plugin_Check_Box_Data_Link.jpg

Share this post


Link to post
Share on other sites

I've removed your download link and locked this thread. This code is NOT okay. Once you've fixed these issues and have a new DLL for download then you can edit your post and put it back up for download and we'll be happy to unlock the thread.

 

You are deriving from PropertyControl which is an internal IndirectUI class. You are also reaching in via reflection and instantiating an internal class (HeadingLabel).

 

Classes are made "internal" specifically so that Effects can't use them. It does not mean you should hack around with reflection to sneakily gain access to it.

 

If you want to use HeadingLabel then just disassemble it with Reflector (or ILSpy etc.) and copy it into your source code. Reflection is 100% not okay.

 

I will be making PropertyControl's constructor "internal" for the next update.

 

Also, a suggestion: name your DLL something more specific than "Tile.dll".

 

Please don't take this is an angry reprimand. I just have to be firm on this type of stuff.

 

Be sure to read the Rules for plugins. I've added a new rule to clarify this.

 

 

https://github.com/DataDink/DinkPDN/blob/master/Source/DinkPDN.Effects.UI/Views/PropertyControl.cs

public abstract class PropertyControl : PaintDotNet.IndirectUI.PropertyControl
{
    private static readonly Assembly HeaderSourceAssembly = Assembly.Load("PaintDotNet.Framework");
    private static readonly Type HeaderSourceType = HeaderSourceAssembly.GetTypes().FirstOrDefault(t => t.FullName == "PaintDotNet.Controls.HeadingLabel");
    private readonly Control _header = HeaderSourceType != null ? (Control)Activator.CreateInstance(HeaderSourceType) : new Label { AutoSize = false };

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this