Jump to content
How to Install Plugins ×
Paint.NET 5.1 is now available! ×

Recommended Posts

Posted

I noticed that Paint.NET does not have an option to Mirror or Rotate a Selection, only the whole Image.

You can Rotate a Selection by using the Right Mouse Button with or without Shift, but the operation is done with trigonometric functions and, implicitely, rounding, generating far from perfect results for 90, 180 and 270 degrees, the only values where it is actually possible to get perfect results.

So I decided to implement these functions:

- Horizontal Mirror (Vertical Flip)

- Vertical Mirror (Horizontal Flip)

- 90 Degrees Clockwise Rotate

- 180 Degrees Rotate

- 270 Degrees Clockwise Rotate (90 Degrees Counter Clockwise Rotate)

While coding, I discovered two more interesting Mirrors and I added them too:

- First Diagonal Mirror

- Second Diagonal Mirror

I updated the Plugin!

1. Now it remembers the last choice.

2. The OK and Cancel Buttons are gone. "None" is now Cancel and all the others are OK. The preview is automated on Button_MouseHover and Button_Enter. This way, you save a click!

3. Try to right-click! You'll see the UI change. Use the UI you like from three choices. The plugin will remember it too.

4. It supports Localization.

You can get this and other plugins plus the source code from here

Toli Cuturicu

Posted

This is very similar to Illnab1024's "Flip" plugin. (See also MadJik's fork)

I do like your UI though.

However, I don't see any effect when I select the "First Diagonal Mirror" and "Second Diagonal Mirror" options.

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Posted

> This is very similar to Illnab1024's "Flip" plugin. (See also MadJik's fork)

Well, the Flip Plugin has only two options: Horizontal and Vertical Mirrors (Flips)

This one has seven.

> I do like the UI though.

It may be better... Thanks anyway.

> However, I don't see any effect when I select the "First Diagonal Mirror" and "Second Diagonal Mirror" options.

First Diagonal Mirror, Second Diagonal Mirror, Rotate 90 Degrees and Rotate 270 Degrees only work when the Selection is a square. Otherwise the result would "get out" of the Selection.

Give it a try, please and tell me if there is any method to get the Selection outside the Render Method (for example in the Effect Constructor)

Posted
Well, the Flip Plugin has only two options: Horizontal and Vertical Mirrors (Flips)

This one has seven.

Madjik's has 3 options...
First Diagonal Mirror, Second Diagonal Mirror, Rotate 90 Degrees and Rotate 270 Degrees only work when the Selection is a square. Otherwise the result would "get out" of the Selection.

Give it a try, please and tell me if there is any method to get the Selection outside the Render Method (for example in the Effect Constructor)

I see now...

Thanks for the response.

 

Take responsibility for your own intelligence. 😉 -Rick Brewster

Posted

Instead of doing nothing, the Buttons that work only when the Selection is Square, are disabled otherwise.

I replaced the original with this update. You can find it at the begining of the post.

Posted

The Default and Cancel Buttons were not properly set. This was fixed.

The UI now remembers its position.

I also shrunk the UI a little.

Posted

> Great!

> I'm going to replace my flip version by this plugin!

Thank you. I will try to make it better.

> Source? I would like to see how to remember the position!

> Thanks!

I feel quite ashamed of releasing the source code, because everybody will then see my mistakes and bad coding practises.

If you think I will not make a fool of myself, probably I will post it after editing it a bit for clarity.

The position is remembered in an *.ini file created in the same directory. Open it with a text editor and look at it.

Form.Left and Form.Top are written there at Form.FormClosing and read from there at Form.Load.

The whole Ini File stuff is wrapped by me in a class IniFile, which I use in many of my projects. It is extremely large, so I stripped all the unnecessary code out of it and added the remaining to this project.

Posted

> Nice, and please put it in "Distort".

> Thanks.

Thank you too.

I am not sure if my plugin performs any distorsion at all. In my point of view, the result is either identical or enantiomorphic with the original, so it is tehnically not distorted.

But I will take it into consideration further.

Posted

Toli,

Fantastic job! I really like the UI how it shows what the result will be with the buttons. This plugin is essential and will especially be easy to use for newer users.

Keep up the great work.

Dave

Posted

> Toli,

> Fantastic job! I really like the UI how it shows what the result will be with the buttons. This plugin is essential and will

> especially be easy to use for newer users.

> Keep up the great work.

> Dave

Thank you for your compliments. Everybody who knows my programs appreciates especially the UI.

I will keep coding, of course.

Posted

Could you use a thumbnail of the current picture instead of a Paint.NET icon?

Just throwing it here...

No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio

Posted

> Could you use a thumbnail of the current picture instead of a Paint.NET icon?

> Just throwing it here...

Sorry, I don't think this would be feasable.

1. Thumbnail of what? The picture? The selection? The Selection Bounds?

2. If it does not have Transparency near the edges it will not look nice on a Button.

3. You see the Effect on the fly on the Canvas anyway.

4. I do not have an algorhythm to save a part of an Image as a *.png / I don't know how to do it.

5. What about the Disabled Buttons. They should display something, shouldn't they?

Posted
Great!

I'm going to replace my flip version by this plugin!

Same here (still keeping Flip installed, though). This rolls up a few functions into one parcel. However, would it be possibly to have all the functions available all of the time? Because virtually all my images are rectangular in shape, yet the need to rotate 90 degrees is still required. I know I could use the built-in one, but I regularly veer to the Effects menu ;).

Perhaps emulate the built-in Rotate when no selection is active - i.e. rotate the entire canvas - and when there is one active still rotate what is in the selection within the selection. What do you think?

Example:

th_rotateexample.jpg

^^Click for larger.

See how it was rotated within the selection? Therefore this would enable all the functions afforded to us available all the time. Is something like my suggestion feasible?

I am not sure if my plugin performs any distorsion at all.

I agree, it suits better in the main Effects menu than any of the submenus.

Posted

> Perhaps emulate the built-in Rotate when no selection is active - i.e. rotate the entire canvas

I am not sure I am able to do that (actually change the Dimensions of the Canvas).

> and when there is one active still rotate what is in the selection within the selection. What do you think?

> See how it was rotated within the selection? Therefore this would enable all the functions afforded to us available

> all the time. Is something like my suggestion feasible?

This would be feasible, but will take some time, because I have some other work to do right now.

Posted

:D

*hides in shame*

1. Thumbnail of what? The picture? The selection? The Selection Bounds?

Yeah, I was thinking about the new bundled effects' dialogs, and in fact they copy the all canvas, disregarding the selection (in the button).

3. You see the Effect on the fly on the Canvas anyway.

True. But you've to click on the buttons to see it.

4.I don't know how to do it.

That's what I've thought. :(

I agree, it suits better in the main Effects menu than any of the submenus.

Agreed.

No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio

Posted
I am not sure I am able to do that (actually change the Dimensions of the Canvas).

...

This would be feasible, but will take some time, because I have some other work to do right now.

Not a problem. Like I said, I can always use the built-in one, that is what it's there for.

...

No need to rush, just putting the idea out there.

Posted

I feel it'd fit better in the Adjustments menu, but that's just me, I dunno how anyone else feels about it.

dA

Son, someday you will make a girl happy for a short period of time. Then she'll leave you & be with men that are ten times

better than you can imagine. These men are called musicians. :D

Posted

I added the new version of my plugin and also the source code.

You can find both of them at the beggining of the thread.

Feel free to ask questions about or to criticize the source code (or binary)

Toli Cuturicu

Posted

I updated it again!

Look at the beggining of the thread.

1. Now it remembers the last choice.

2. The OK and Cancel Buttons are gone. "None" is now Cancel and all the others are OK. The preview is automated on Button_MouseHover and Button_Enter. This way, you save a click!

3. Try to right-click! You'll see the UI change. Use the UI you like from three choices. The plugin will remember it too.

Comments?

Posted

Hum... I don't know... I don't think changing the LaF (look and feel) is a good thing even if one has had the cleverest idea ever. It's always a new thing users must learn and be aware of, and this is not a good thing... believe me, I'm software architect for more than 23 years now (geeeeee! :shock:) :lol:

Btw, thanks for this really great plugin!

"Be who you are and say what you feel because those who mind don't matter and those who matter don't mind."

~Dr. Seuss

Posted

Nice!

It's even usable with the keyboard!

Thanks for sharing the source.

No. Way. I've just seen Bob. And... *poof!*—just like that—he disappears into the mist again. ~Helio

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.

×
×
  • Create New...