Recent

Author Topic: FillQuadLinearColorAntialias paints semitransparent - why ??  (Read 873 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
FillQuadLinearColorAntialias paints semitransparent - why ??
« on: November 20, 2020, 01:13:46 am »
Hi!

I just did a

Code: Pascal  [Select][+][-]
  1. FillQuadLinearColor(Rtop[i],RTop[i+1],RBottom[i+1],RBottom[i],
  2.                                           cssGold,cssGold, CSSGoldenrod, CSSGoldenrod);  

Everything is fine. The colors are opaque.
But no AntiAlias. Because of the stairs I changed to

Code: Pascal  [Select][+][-]
  1. FillQuadLinearColorAntiAlias(Rtop[i],RTop[i+1],RBottom[i+1],RBottom[i],
  2.                                           cssGold,cssGold, CSSGoldenrod, CSSGoldenrod);  

And now the strange thing happens:
The Alpha value seems to be 128.
The colors are semitransparent..

Bug or is there a trick to revert the Alpha values back to 255?

Winni
 
« Last Edit: November 20, 2020, 01:15:20 am by winni »

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: FillQuadLinearColorAntialias paints semitransparent - why ??
« Reply #1 on: November 20, 2020, 01:25:23 am »

Two screenshots about the problem.

Who wants to drink semitransparent beer?

Winni

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: FillQuadLinearColorAntialias paints semitransparent - why ??
« Reply #2 on: November 20, 2020, 09:13:51 am »
That shouldn't be transparent.

Do you have a simple test program?
Conscience is the debugger of the mind

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: FillQuadLinearColorAntialias paints semitransparent - why ??
« Reply #3 on: November 20, 2020, 08:04:29 pm »
Hi circular!

Made a little demo of that problem - in the attachment.

Winni

circular

  • Hero Member
  • *****
  • Posts: 4220
    • Personal webpage
Re: FillQuadLinearColorAntialias paints semitransparent - why ??
« Reply #4 on: November 21, 2020, 02:42:06 pm »
Ok I understand.

Well that's normal because when here there are multiple polygons that are adjacent. On the antialias border, pixels are drawn with a certain opacity. When drawing with a certain opacity, the opacities are not added, so in the end you get something transparent.

If you want to draw such adjacent polygons with antialias, you need to use TBGRAMultishapeFiller class of BGRAPolygon unit. There you can give a lot of polygons and draw them in one go.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018