ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Eraser Brush Tool does not show transparency chessboard background

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PeterPanino Posted - Dec 28 2021 : 10:18:58
I have added an OnUserInteraction handler to this ImageEn demo:
\Demos\ImageEditing\BrushTool

procedure TForm1.ImageEnView1UserInteraction(Sender: TObject; Event: TIEUserInteractionEvent; Info: Integer);
begin
  case Event of
    ieiPaintEnd:
      begin
        if ImageEnView1.IEBitmap.HasAlphaChannel(True) then
        begin
          ImageEnView1.SetChessboardStyle(16, Graphics.bsSolid, clWhite, $00EEEEEE);
          ImageEnView1.BackgroundStyle := iebsChessboard;
        end
        else
          ImageEnView1.BackgroundStyle := iebsSolid;
      end;
  end;
end;


This shows a chessboard background for transparent areas. (The modified demo project is attached).

Then I loaded the image file colorfields.png that is contained in the attached zip file.

Then I configured the Brush Type as Eraser:



Then I painted with the configured Eraser Brush:



You can see that while the upper left semi-transparent color field has a Chessboard background, the area painted with the Eraser Brush has NO chessboard background! Why? Isn't the Eraser supposed to set the Alpha Transparency of the painted area to 0 when EraserOpacity = 1.0?

Documentation: "TIEBrushToolInteraction.EraserOpacity: 1.0 will completely erase (Alpha will become 0)."

attach/PeterPanino/20211228101530_PaintBrush.zip
53.14 KB
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 09 2022 : 22:41:40
Hi Peter

I cannot reproduce that. Can you try calling ImageEnView1.Update(); or Invalidate(); after setting the background color. Or specifying at the time of loading.

Nigel
Xequte Software
www.imageen.com
xequte Posted - Dec 29 2021 : 15:19:20
Hi Peter

I'll need to look into this when we are back in the office in the new year.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Dec 28 2021 : 11:36:04
This is VERY STRANGE: When I move the PaintBrush demo window (or even this browser window!) to my second external monitor, then the chessboard background is shown for the painted area!! When I move the window back to my primary monitor, then a white solid area is shown instead of the chessboard background!! Is this MAGIC??

I had to document this with my camera, otherwise, no one will believe this - I shot two camera photos from the SAME! Paint Brush demo window on each of my two monitors:

Monitor 1:



Monitor 2:



Can anyone explain this?

(The Moiré effect visible on the photos is a side effect of the camera lens when taking a photo from a monitor screen - it is not visible by the human eye when looking at the computer screen, because the human brain compensates for such undesired effects).