Aziz Posted May 13, 2008 Posted May 13, 2008 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. Quote http://aaziz.org | Outline Selection Plugin | Gallery of Aziz
I Like Pi Posted May 13, 2008 Posted May 13, 2008 To check is a pixel is in the selection: PdnRegion selectionRegion = EnvironmentParameters.GetSelection(srcArgs.Surface.Bounds); selectionRegion.IsVisible(new Point(x, y)) Unfortunately, you cannot modify the selection with any kind of plugin. Quote
Aziz Posted May 13, 2008 Author Posted May 13, 2008 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. Quote http://aaziz.org | Outline Selection Plugin | Gallery of Aziz
BoltBait Posted May 13, 2008 Posted May 13, 2008 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! Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game
Aziz Posted May 13, 2008 Author Posted May 13, 2008 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 Anyways, thanks for the blunt answer Quote http://aaziz.org | Outline Selection Plugin | Gallery of Aziz
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.