Eraser on canvas with vertical arrangement as backround

I have a problem with creating an eraser in the canvas which already has a background image.
the problem is that the background image is in the vertical arrangement and I can't use the option for background pixel remembering.

I made an eraser with the make color block and added the fourth item with 0 data and it worked. however when I added an opacity slider it didn't work anymore.

I already tried to limit the slider to 1-100 and put on the erase button 0, but that still doesn't work, it just puts the brush to fully transparent. I mean this way it kinda makes more sense, but then why does it work when the opacity function isn't there?

please can someone explain to me how to fix this?

this is the code for the eraser, I have more code than this, but this is the important part for my question.

  1. Set the slider to 0-255
  2. Set the Canvas1.PaintColor blocks in the .PositionChanged event. You could also put the Canvas1.LineWidth blocks there too.
  3. Also put the two Canvas1 setting blocks above in your event

That doesn't work, it actually worsens the code. Now instead of line width and color changing automatically, it changes only when you want to change opacity and I don't want that.
The biggest problem I have with this is that before, I could just put the transparency to 0 and it would erase the colours like an actual eraser, but now that I added opacity to it (as in more numbers to choose from), it changes the number 0 from being an indicator for erasing to being an indicator for 100% transparency.
Do you have any idea how to fix this problem? I'm out of them and have no idea how to fix it.

Try like this

Setting a colour's opacity to 0 still draws a colour, even if it looks transparent, you have to set the colour to 16777215 (or 255,255,255,0) to make a transparent eraser effect

It still doesn't it makes the 0 a 100% opacity. I'm going to add my aia. project so that you can access the whole code maybe something is wrong with the rest of the code that is making this problem.
photoshop.aia (46.7 KB)

Remove these blocks:

from Canvas1 dragged and touched. Should work OK ....

Thank you that works, can't believe I missed those blocks...

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.