Recent

Author Topic: BGRA ReplaceColor: Issue with BGRAPixelTransparent  (Read 505 times)

winni

  • Hero Member
  • *****
  • Posts: 1778
BGRA ReplaceColor: Issue with BGRAPixelTransparent
« on: December 01, 2019, 06:17:55 pm »
Hi!

This is not a bug but it should be noticed:

With introducing the ColorMask in ReplaceColor this is not anymore possible:

Code: Pascal  [Select][+][-]
  1. mask.ReplaceColor(BGRAPixelTransparent,CssWhite);

This worked on 9.x

Why the hell do I need it?
I wantend to replace transparent with white while creating a mask!
But you can get around this issue because the other way round it works:

Code: Pascal  [Select][+][-]
  1. mask.ReplaceColor(CssWhite, BGRAPixelTransparent);

So I changed the logic and build the mask around this problem.

Winni



circular

  • Hero Member
  • *****
  • Posts: 3440
    • Personal webpage
Re: BGRA ReplaceColor: Issue with BGRAPixelTransparent
« Reply #1 on: December 01, 2019, 09:18:54 pm »
Oh I see, it is a problem with the overload. The function with TBGRAPixel parameter is hidden by the function with TColor parameters. I fixed it on dev branch.

Note that if you want to replace the transparent color, the method ReplaceTransparent is here for you.
Conscience is the debugger of the mind

winni

  • Hero Member
  • *****
  • Posts: 1778
Re: BGRA ReplaceColor: Issue with BGRAPixelTransparent
« Reply #2 on: December 02, 2019, 12:09:20 am »

Note that if you want to replace the transparent color, the method ReplaceTransparent is here for you.

Thanx. Good to know. I overlooked it until now! 😎

Winni

 

TinyPortal © 2005-2018