Jump to content

Manipulating Selection


Aziz
 Share

Recommended Posts

Hi. I've been looking through the Selection class source and looking at some of the methods.

I noticed (while fooling around in CodeLab for the first time), that you get the selection bounds as a rectangle from the Selection object. So really you're affecting a box area. Now, if you have a non-rectangular selection (ellipse, or selected multiple areas with union select mode), the plugin only effects that within the selection.

So, my question is, is there a way to find out what exact pixel are selected? Something like a Selection.ContainsPoint() method? And, furthermore, to manipulate the selection, such as add/remove point from it, etc. I can think of a couple of plugins I'd write that would use this functionality:

1. Select Layer. Not selecting the entire canvas, but rather selecting all non-transparant pixels in the layer. Similar to Photoshop's Ctrl+Click on the layer menu

2. Select Range functionality (Again, from photoshop), which would allow the user to select only certain colours/brightnesses, etc.

And a whole slew of other selection adding/making functions.

Link to comment
Share on other sites

Is there any way at all, then, to modify selection with code, other than modifying the source code of the program?

Similar question: is it posible to modify the area of a layer, outside of the selection? I noticed that the effects are 'truncated', so to speak, to the area of the selection.

Link to comment
Share on other sites

Is there any way at all, then, to modify selection with code, other than modifying the source code of the program?

Similar question: is it posible to modify the area of a layer, outside of the selection? I noticed that the effects are 'truncated', so to speak, to the area of the selection.

No and no.

If the user selects an area and then calls your effect, the user doesn't want anything outside of their selection modified. That's why they made a selection in the first place!

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

No and no.

If the user selects an area and then calls your effect, the user doesn't want anything outside of their selection modified. That's why they made a selection in the first place!

I see your point, but I think that in the right circumstances, it'd be nice to use :P Anyways, thanks for the blunt answer :D

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...