Recent

Author Topic: BGRAGradient Error  (Read 962 times)

winni

  • Hero Member
  • *****
  • Posts: 3197
BGRAGradient Error
« on: October 18, 2019, 10:51:17 pm »
@circular

Hi!

I have just played with the more seldom used params for  GradientFill.

Bloody simple code:

Code: Pascal  [Select][+][-]
  1. function GradientError(wi,hi : Integer) : TBGRABitmap;
  2. var tmp : TBGRABitmap;
  3. begin
  4. tmp := TBGRABitmap.Create(wi,hi);
  5. tmp.GradientFill(0,0,wi,hi, cssOrange,cssBlue, gtAngular, PointF(0,0),PointF(wi,hi),dmSet);
  6. result := tmp;
  7. end;
  8.  

There is no gradient at all. There are two triangles.

I've got three ideas for a solution

* You call it Planck Gradient - radiation is emitted, transmitted and absorbed only in discrete energy packets
* This is a bug
* I have not understood  gtAngular - perhaps of missing doc.

Winni



circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: BGRAGradient Error
« Reply #1 on: October 19, 2019, 09:56:31 am »
Winni is on fire today.  :o

The angular gradients rotates around the first point you supply. Try putting it in the middle of the bitmap instead. The second point indicate the direction of the starting ray.

There is a discontinuity indeed because the gradient ends at the same place when it has done 360 degrees.

Where you expecting something different? Maybe a gradient I have not imagined yet?

Indeed documentation is not very thorough. Any help with it would be appreciated.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018