2

Is it possible to edit a layer's image? I mean, having a TImgView with multiple selectable layers, I would like to know if it is possible to select one layer (rubber-band and all), and for example click a button in the menu, and the mouse would turn into a rubber eraser that can delete contents under the mouse, on click. Just like the eraser in Paint.net or Photoshop.

Is it possible to achieve this? And if so, then how? I could not find a way of doing that so far. In regular TImage (TPaintBox) the solution would be to draw with white on top of the background, but that is not a solution when working with transparent layers/images. So what to do?

Any help (code) would be appreciated.

Thank you

user1137313
  • 2,390
  • 9
  • 44
  • 91
  • Not sure if the proper way, but testing with code in http://stackoverflow.com/questions/28550072/delphi-graphics32-relative-mouse-position-to-the-layer, changing the pencolor to 0 erases to transparent what has been drawn before. An eraser should of course not be line based. To make a smooth edge one would have to play with the alpha channel of the pixels. – Tom Brunberg Feb 17 '15 at 19:07
  • Working on a drawing-layer, I find that the solution is to make the brush.color=0, because the pen only makes the contour transparent while the inside of the drawing is filled with the brushes color. Thank you for pointing me into the right direction. Make your comment into an answer so I can accept it – user1137313 Feb 17 '15 at 22:18

0 Answers0