Recent

Author Topic: BGRAbitmap Gradient  (Read 23671 times)

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #30 on: May 05, 2016, 10:17:35 pm »
I know that photoshop for calculating the color of point between gradient positions, gain it as 50/50 from color in left and right of the point, i mean that where ever the point is in between of two positions, it gains its color as i said, but my question is how to calculate this gaing collor as 50/50.
in my code if i use blue and green, i get this results, first screenshot is for gradient with two point and from BGRA(0,255,0) to BGRA(0,0,255), and the second one is a gradient with 3 points: BGRA(0,255,0) and avg of two colors and BGRA(0,0,255).
the difference is what i think is about my formula in calculating the avg color, which i dont know exactly how photoshop does it.
any help appreciated prior 



circular

  • Hero Member
  • *****
  • Posts: 4193
    • Personal webpage
Re: BGRAbitmap Gradient
« Reply #31 on: May 06, 2016, 12:38:36 am »
Adding an intermediate color would not give you the same progression of the color, because the cosine interpolation "makes a pause" at each color, so that would be the case also for the intermediate color.

You can keep a linear interpolation (the default) and add multiple intermediate colors. Here is for example how to do that using a spline:
Code: Pascal  [Select][+][-]
  1. uses BGRAResample, BGRAGradientScanner, BGRABitmapTypes;
  2.  
  3. function CreateSplineGradient(const AColors: array of TBGRAPixel; const APositions: array of single; APrecision: integer = 10; ASplineCoeff: single = 0.25): TBGRAMultiGradient;
  4.  
  5.   function ColorFToBGRA(c: TColorF): TBGRAPixel;
  6.     function ClampByte(AValue: NativeInt): NativeInt;
  7.     begin
  8.       if AValue <= 0 then
  9.         result := 0
  10.       else if AValue >= 255 then
  11.         result := 255
  12.       else
  13.         result := AValue;
  14.     end;
  15.   begin
  16.     result := BGRA(ClampByte(round(c[1])),ClampByte(round(c[2])),
  17.                    ClampByte(round(c[3])),ClampByte(round(c[4])))
  18.   end;
  19.  
  20.   function GetIntermediateColorF(k: TWideKernelFilter; c1,c2,c3,c4: TColorF; t: single): TColorF;
  21.   begin
  22.     result := c1*k.Interpolation(t+1) + c2*k.Interpolation(t) +
  23.               c3*k.Interpolation(t-1)  + c4*k.Interpolation(t-2);
  24.   end;
  25.  
  26.   function GetIntermediatePosition(k: TWideKernelFilter; p1,p2,p3,p4: single; t: single): single;
  27.   begin
  28.     result := p1*k.Interpolation(t+1) + p2*k.Interpolation(t) +
  29.               p3*k.Interpolation(t-1)  + p4*k.Interpolation(t-2);
  30.   end;
  31.  
  32. var
  33.   paddedColorsF: array of TColorF;
  34.   paddedPos: array of single;
  35.  
  36.   interpColors: array of TBGRAPixel;
  37.   interpPos: array of single;
  38.  
  39.   i,j, index: integer;
  40.   k: TWideKernelFilter;
  41.   t: single;
  42. begin
  43.   if length(AColors)<>length(APositions) then
  44.     raise EArgumentException.Create('Array size mismatch');
  45.   if length(AColors)<2 then
  46.     raise EArgumentException.Create('At least 2 color needed');
  47.   setlength(paddedColorsF, length(AColors)+2);
  48.   setlength(paddedPos, length(APositions)+2);
  49.   for i := 0 to high(AColors) do
  50.   begin
  51.     with AColors[i] do paddedColorsF[i+1] := ColorF(red,green,blue,alpha);
  52.     paddedPos[i+1] := APositions[i];
  53.   end;
  54.   paddedColorsF[0] := paddedColorsF[1]*2-paddedColorsF[2];
  55.   paddedColorsF[high(paddedColorsF)] := paddedColorsF[high(paddedColorsF)-1]*2-paddedColorsF[high(paddedColorsF)-2];
  56.   paddedPos[0] := 2*paddedPos[1]-paddedPos[2];
  57.   paddedPos[high(paddedPos)] := 2*paddedPos[high(paddedPos)-1]-paddedPos[high(paddedPos)-2];
  58.   setlength(interpColors, (length(AColors)-1)*APrecision+1);
  59.   setlength(interpPos, length(interpColors));
  60.   index := 0;
  61.   k := TSplineKernel.Create(ASplineCoeff);
  62.   for i := 0 to high(AColors)-1 do
  63.   begin
  64.     for j := 0 to APrecision-1 do
  65.     begin
  66.       t := j/APrecision;
  67.       interpPos[index] := GetIntermediatePosition(k,paddedPos[i],paddedPos[i+1],paddedPos[i+2],paddedPos[i+3], t);
  68.       interpColors[index] := ColorFToBGRA(GetIntermediateColorF(k,paddedColorsF[i],paddedColorsF[i+1],paddedColorsF[i+2],paddedColorsF[i+3], t));
  69.       inc(index);
  70.     end;
  71.   end;
  72.   k.Free;
  73.   interpPos[index] := paddedPos[high(paddedPos)-1];
  74.   interpColors[index] := ColorFToBGRA(paddedColorsF[high(paddedColorsF)-1]);
  75.   result := TBGRAMultiGradient.Create(interpColors,interpPos,True);
  76. end;  

And then create your gradient like that:
Code: Pascal  [Select][+][-]
  1. g := CreateSplineGradient([CSSRed,CSSLime,CSSBlue],[0,0.5,1]);  
Conscience is the debugger of the mind

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #32 on: May 07, 2016, 01:06:48 pm »
I am not sure how to implement what i want with this method, i wanted to insert points like PSD, points with one value of colors, but with Arbitrary position, as you can see in screenshot, points are not a new position with new color! they are just points that gain their value as 50/50 from the left and right color.

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #33 on: May 07, 2016, 04:57:47 pm »
I tested something to gain "points concept in photoshop" in bgrabitmap. in this code i draw a gradient with 3 points, but the second point is the value that i gained from a  two colors gradient, in percent that i want(second screenshot), i thought maybe the result would be the same as a photoshop gradient with 2 colors and 2 position and with a point between them, but the result is not what i want yet! in fact i want a gradient with 2 colors and a point in between them to be able to move the point, in second screenshot, i show you the result of  bgra gradient with 2colors, from yellow (255,255,0) to blue (0,0,255). third screenshot is the gradient with 2 cololrs from blue to yellow in photoshop.
i will share what i mean about photoshop in a mp4 file, and screenshots in drop box.
link: https://www.dropbox.com/sh/5aztyqcwa1tesro/AADMbOxjgE6gQcVLAsqM8XDZa?dl=0
any help appreciated prior


Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9.   BGRABitmap, BGRABitmapTypes, BGRAGradients, BGRAGradientScanner;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     procedure FormPaint(Sender: TObject);
  17.   private
  18.   public
  19.     procedure DrawGrad;
  20.     function GetColorOfPoint(c1, c2: TBGRAPixel; Percent: single): TBGRAPixel;
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.lfm}
  29.  
  30. { TForm1 }
  31.  
  32. procedure TForm1.FormPaint(Sender: TObject);
  33. begin
  34.   DrawGrad;
  35. end;
  36.  
  37. procedure TForm1.DrawGrad;
  38. var
  39.   bmp: TBGRABitmap;
  40.   p1, p2: TPointF;
  41.   g: TBGRAMultiGradient;
  42.   gs: TBGRAGradientScanner;
  43.   ArrBgraColor1: array [0..1] of TBGRAPixel;
  44.   ArrBgraColor2: array [0..2] of TBGRAPixel;
  45. begin
  46.   Form1.Width := 600;
  47.   Form1.Height := 360;
  48.   bmp := TBGRABitmap.Create(Width, Height);
  49.   p1 := PointF(0, 0);
  50.   p2 := PointF(Width, 0);
  51.   //1
  52.   //ArrBgraColor1[0] := BGRA(0, 0, 255);
  53.   //ArrBgraColor1[1] := BGRA(255, 255, 0);
  54.   //g := TBGRAMultiGradient.Create(ArrBgraColor1, [0, 1], True, False);
  55.   //g.InterpolationFunction := @g.CosineInterpolation;
  56.   //gs := TBGRAGradientScanner.Create(g, gtLinear, p1, p2);
  57.   //bmp.FillRect(0, 0, Width, Height, gs, dmDrawWithTransparency, daFloydSteinberg);
  58.   //bmp.SaveToFile('Pics\B1.png');
  59.   //bmp.Draw(Canvas, 0, 0);
  60.   //bmp.Free;
  61.   //2
  62.   ArrBgraColor2[0] := BGRA(0, 0, 255);
  63.   ArrBgraColor2[2] := BGRA(255, 255, 0);
  64.   ArrBgraColor2[1] := GetColorOfPoint(ArrBgraColor2[0], ArrBgraColor2[2], 50);
  65.  
  66.   g := TBGRAMultiGradient.Create(ArrBgraColor2, [0,0.5, 1], True, False);
  67.   g.InterpolationFunction := @g.CosineInterpolation;
  68.   gs := TBGRAGradientScanner.Create(g, gtLinear, p1, p2);
  69.   bmp.FillRect(0, 0, Width, Height, gs, dmDrawWithTransparency, daFloydSteinberg);
  70.   bmp.SaveToFile('Pics\B2.png');
  71.   bmp.Draw(Canvas, 0, 0);
  72.   bmp.Free;
  73. end;
  74.  
  75. function TForm1.GetColorOfPoint(c1, c2: TBGRAPixel; Percent: single): TBGRAPixel;
  76. var
  77.   bmp: TBGRABitmap;
  78.   p1, p2: TPointF;
  79.   g: TBGRAMultiGradient;
  80.   gs: TBGRAGradientScanner;
  81.   ArrBgraColor: array [0..1] of TBGRAPixel;
  82. begin
  83.   bmp := TBGRABitmap.Create(Width, 5);
  84.   p1 := PointF(0, 0);
  85.   p2 := PointF(Width, 0);
  86.  
  87.   ArrBgraColor[0] := c1;
  88.   ArrBgraColor[1] := c2;
  89.   g := TBGRAMultiGradient.Create(ArrBgraColor, [0, 1], True, False);
  90.   g.InterpolationFunction := @g.CosineInterpolation;
  91.   gs := TBGRAGradientScanner.Create(g, gtLinear, p1, p2);
  92.   bmp.FillRect(0, 0, Width, bmp.Height, gs, dmDrawWithTransparency, daFloydSteinberg);
  93.   Result:=fpColorToBGRA(bmp.Colors[round((bmp.Width * Percent/100)),3]);
  94.   bmp.Free;
  95. end;
  96. end.
  97.  

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #34 on: July 25, 2016, 02:19:11 pm »
Adding an intermediate color would not give you the same progression of the color, because the cosine interpolation "makes a pause" at each color, so that would be the case also for the intermediate color.

You can keep a linear interpolation (the default) and add multiple intermediate colors. Here is for example how to do that using a spline:
Code: Pascal  [Select][+][-]
  1. uses BGRAResample, BGRAGradientScanner, BGRABitmapTypes;
  2.  
  3. function CreateSplineGradient(const AColors: array of TBGRAPixel; const APositions: array of single; APrecision: integer = 10; ASplineCoeff: single = 0.25): TBGRAMultiGradient;
  4.  
  5.   function ColorFToBGRA(c: TColorF): TBGRAPixel;
  6.     function ClampByte(AValue: NativeInt): NativeInt;
  7.     begin
  8.       if AValue <= 0 then
  9.         result := 0
  10.       else if AValue >= 255 then
  11.         result := 255
  12.       else
  13.         result := AValue;
  14.     end;
  15.   begin
  16.     result := BGRA(ClampByte(round(c[1])),ClampByte(round(c[2])),
  17.                    ClampByte(round(c[3])),ClampByte(round(c[4])))
  18.   end;
  19.  
  20.   function GetIntermediateColorF(k: TWideKernelFilter; c1,c2,c3,c4: TColorF; t: single): TColorF;
  21.   begin
  22.     result := c1*k.Interpolation(t+1) + c2*k.Interpolation(t) +
  23.               c3*k.Interpolation(t-1)  + c4*k.Interpolation(t-2);
  24.   end;
  25.  
  26.   function GetIntermediatePosition(k: TWideKernelFilter; p1,p2,p3,p4: single; t: single): single;
  27.   begin
  28.     result := p1*k.Interpolation(t+1) + p2*k.Interpolation(t) +
  29.               p3*k.Interpolation(t-1)  + p4*k.Interpolation(t-2);
  30.   end;
  31.  
  32. var
  33.   paddedColorsF: array of TColorF;
  34.   paddedPos: array of single;
  35.  
  36.   interpColors: array of TBGRAPixel;
  37.   interpPos: array of single;
  38.  
  39.   i,j, index: integer;
  40.   k: TWideKernelFilter;
  41.   t: single;
  42. begin
  43.   if length(AColors)<>length(APositions) then
  44.     raise EArgumentException.Create('Array size mismatch');
  45.   if length(AColors)<2 then
  46.     raise EArgumentException.Create('At least 2 color needed');
  47.   setlength(paddedColorsF, length(AColors)+2);
  48.   setlength(paddedPos, length(APositions)+2);
  49.   for i := 0 to high(AColors) do
  50.   begin
  51.     with AColors[i] do paddedColorsF[i+1] := ColorF(red,green,blue,alpha);
  52.     paddedPos[i+1] := APositions[i];
  53.   end;
  54.   paddedColorsF[0] := paddedColorsF[1]*2-paddedColorsF[2];
  55.   paddedColorsF[high(paddedColorsF)] := paddedColorsF[high(paddedColorsF)-1]*2-paddedColorsF[high(paddedColorsF)-2];
  56.   paddedPos[0] := 2*paddedPos[1]-paddedPos[2];
  57.   paddedPos[high(paddedPos)] := 2*paddedPos[high(paddedPos)-1]-paddedPos[high(paddedPos)-2];
  58.   setlength(interpColors, (length(AColors)-1)*APrecision+1);
  59.   setlength(interpPos, length(interpColors));
  60.   index := 0;
  61.   k := TSplineKernel.Create(ASplineCoeff);
  62.   for i := 0 to high(AColors)-1 do
  63.   begin
  64.     for j := 0 to APrecision-1 do
  65.     begin
  66.       t := j/APrecision;
  67.       interpPos[index] := GetIntermediatePosition(k,paddedPos[i],paddedPos[i+1],paddedPos[i+2],paddedPos[i+3], t);
  68.       interpColors[index] := ColorFToBGRA(GetIntermediateColorF(k,paddedColorsF[i],paddedColorsF[i+1],paddedColorsF[i+2],paddedColorsF[i+3], t));
  69.       inc(index);
  70.     end;
  71.   end;
  72.   k.Free;
  73.   interpPos[index] := paddedPos[high(paddedPos)-1];
  74.   interpColors[index] := ColorFToBGRA(paddedColorsF[high(paddedColorsF)-1]);
  75.   result := TBGRAMultiGradient.Create(interpColors,interpPos,True);
  76. end;  

And then create your gradient like that:
Code: Pascal  [Select][+][-]
  1. g := CreateSplineGradient([CSSRed,CSSLime,CSSBlue],[0,0.5,1]);  


Hi Circular
Can you please explain a bit about the method and what exactly it is going to do about point concept in Photoshop(as i explained previously)??
any help appreciated prior
regards

circular

  • Hero Member
  • *****
  • Posts: 4193
    • Personal webpage
Re: BGRAbitmap Gradient
« Reply #35 on: July 25, 2016, 03:13:34 pm »
As I understand it, Photoshop gradient is a spline interpolation of the colors. So this computes the spline interpolation, that can be fed to BGRABitmap gradients.
Conscience is the debugger of the mind

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #36 on: July 27, 2016, 03:02:44 pm »
Still do not work properly, I mean it seems that this method still does not handle color play with exact position! as you can see in Screenshots it seems that the interpolation is different, as you can see in my code, I used the method to gain color in between the other 2 colors, and I tested it in position 20% and the compared gradient in Photoshop is different yet!
first Screenshot is attached is Photoshop gradient from (0,255,0) to (0,0,255) with a point between them in position 20%, and second Screenshot is my code gradient result.

any help appreciated prior
regards

here is my code :
Code: Pascal  [Select][+][-]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
  9.   BGRABitmap, BGRABitmapTypes, BGRAGradients, BGRAGradientScanner, BGRAResample;
  10.  
  11. type
  12.  
  13.   { TForm1 }
  14.  
  15.   TForm1 = class(TForm)
  16.     procedure FormPaint(Sender: TObject);
  17.   private
  18.   public
  19.     function AVGColor(c1, c2: TBGRAPixel; Percent: single): TBGRAPixel;
  20.     function CreateSplineGradient(const AColors: array of TBGRAPixel; const APositions: array of single; APrecision: integer = 10; ASplineCoeff: single = 0.25): TBGRAMultiGradient;
  21.   end;
  22.  
  23. var
  24.   Form1: TForm1;
  25.  
  26. implementation
  27.  
  28. {$R *.lfm}
  29.  
  30. { TForm1 }
  31. function TForm1.CreateSplineGradient(const AColors: array of TBGRAPixel; const APositions: array of single; APrecision: integer = 10; ASplineCoeff: single = 0.25): TBGRAMultiGradient;
  32.  
  33.   function ColorFToBGRA(c: TColorF): TBGRAPixel;
  34.  
  35.     function ClampByte(AValue: NativeInt): NativeInt;
  36.     begin
  37.       if AValue <= 0 then
  38.         Result := 0
  39.       else if AValue >= 255 then
  40.         Result := 255
  41.       else
  42.         Result := AValue;
  43.     end;
  44.  
  45.   begin
  46.     Result := BGRA(ClampByte(round(c[1])), ClampByte(round(c[2])), ClampByte(round(c[3])), ClampByte(round(c[4])));
  47.   end;
  48.  
  49.   function GetIntermediateColorF(k: TWideKernelFilter; c1, c2, c3, c4: TColorF; t: single): TColorF;
  50.   begin
  51.     Result := c1 * k.Interpolation(t + 1) + c2 * k.Interpolation(t) + c3 * k.Interpolation(t - 1) + c4 * k.Interpolation(t - 2);
  52.   end;
  53.  
  54.   function GetIntermediatePosition(k: TWideKernelFilter; p1, p2, p3, p4: single; t: single): single;
  55.   begin
  56.     Result := p1 * k.Interpolation(t + 1) + p2 * k.Interpolation(t) + p3 * k.Interpolation(t - 1) + p4 * k.Interpolation(t - 2);
  57.   end;
  58.  
  59. var
  60.   paddedColorsF: array of TColorF;
  61.   paddedPos: array of single;
  62.  
  63.   interpColors: array of TBGRAPixel;
  64.   interpPos: array of single;
  65.  
  66.   i, j, index: integer;
  67.   k: TWideKernelFilter;
  68.   t: single;
  69. begin
  70.   if length(AColors) <> length(APositions) then
  71.     raise EArgumentException.Create('Array size mismatch');
  72.   if length(AColors) < 2 then
  73.     raise EArgumentException.Create('At least 2 color needed');
  74.   setlength(paddedColorsF, length(AColors) + 2);
  75.   setlength(paddedPos, length(APositions) + 2);
  76.   for i := 0 to high(AColors) do
  77.   begin
  78.     with AColors[i] do
  79.       paddedColorsF[i + 1] := ColorF(red, green, blue, alpha);
  80.     paddedPos[i + 1] := APositions[i];
  81.   end;
  82.   paddedColorsF[0] := paddedColorsF[1] * 2 - paddedColorsF[2];
  83.   paddedColorsF[high(paddedColorsF)] := paddedColorsF[high(paddedColorsF) - 1] * 2 - paddedColorsF[high(paddedColorsF) - 2];
  84.   paddedPos[0] := 2 * paddedPos[1] - paddedPos[2];
  85.   paddedPos[high(paddedPos)] := 2 * paddedPos[high(paddedPos) - 1] - paddedPos[high(paddedPos) - 2];
  86.   setlength(interpColors, (length(AColors) - 1) * APrecision + 1);
  87.   setlength(interpPos, length(interpColors));
  88.   index := 0;
  89.   k := TSplineKernel.Create(ASplineCoeff);
  90.   for i := 0 to high(AColors) - 1 do
  91.   begin
  92.     for j := 0 to APrecision - 1 do
  93.     begin
  94.       t := j / APrecision;
  95.       interpPos[index] := GetIntermediatePosition(k, paddedPos[i], paddedPos[i + 1], paddedPos[i + 2], paddedPos[i + 3], t);
  96.       interpColors[index] := ColorFToBGRA(GetIntermediateColorF(k, paddedColorsF[i], paddedColorsF[i + 1], paddedColorsF[i + 2], paddedColorsF[i + 3], t));
  97.       Inc(index);
  98.     end;
  99.   end;
  100.   k.Free;
  101.   interpPos[index] := paddedPos[high(paddedPos) - 1];
  102.   interpColors[index] := ColorFToBGRA(paddedColorsF[high(paddedColorsF) - 1]);
  103.   Result := TBGRAMultiGradient.Create(interpColors, interpPos, True);
  104. end;
  105.  
  106. procedure TForm1.FormPaint(Sender: TObject);
  107. var
  108.   bmp: TBGRABitmap;
  109.   p1, p2: TPointF;
  110.   g: TBGRAMultiGradient;
  111.   gs: TBGRAGradientScanner;
  112. begin
  113.   bmp := TBGRABitmap.Create(Width, Height);
  114.   p1 := PointF(0, Height / 2);
  115.   p2 := PointF(Width, Height / 2);
  116.   g := CreateSplineGradient([BGRA(0, 255, 0), AVGColor(BGRA(0, 255, 0), BGRA(0, 0, 255), 20), BGRA(0, 0, 255)], [0, 0.2, 1]);
  117.   gs := TBGRAGradientScanner.Create(g, gtLinear, p1, p2);
  118.   bmp.FillRect(0, 0, Width, Height, gs, dmDrawWithTransparency, daFloydSteinberg);
  119.   bmp.SaveToFile('Pics\BGRA_20.png');
  120.   bmp.Draw(Canvas, 0, 0);
  121.   bmp.Free;
  122. end;
  123.  
  124. function TForm1.AVGColor(c1, c2: TBGRAPixel; Percent: single): TBGRAPixel;
  125. var
  126.   h1, h2, Res: THSLAPixel;
  127. begin
  128.   h1 := BGRAToHSLA(c1);
  129.   h2 := BGRAToHSLA(c2);
  130.   with h1 do
  131.     WriteLn('H1', ': ', hue, ', ', saturation, ', ', lightness, ', ', alpha);
  132.   with h2 do
  133.     WriteLn('H2', ': ', hue, ', ', saturation, ', ', lightness, ', ', alpha);
  134.   with Res do
  135.   begin
  136.     hue := round((h1.hue + h2.hue) * Percent / 100);
  137.     saturation := round((h1.saturation + h2.saturation) * Percent / 100);
  138.     lightness := round((h1.lightness + h2.lightness) * Percent / 100);
  139.     alpha := round((h1.alpha + h2.alpha) * Percent / 100);
  140.     WriteLn('Result: ', ',', hue, ', ', saturation, ', ', lightness, ', ', alpha);
  141.   end;
  142.   Result := HSLAToBGRA(Res);
  143. end;
  144.  
  145. end.
  146.  
« Last Edit: July 31, 2016, 03:40:29 pm by simin_sh »

circular

  • Hero Member
  • *****
  • Posts: 4193
    • Personal webpage
Re: BGRAbitmap Gradient
« Reply #37 on: July 31, 2016, 05:44:15 pm »
Indeed, the function I provided does not handle the intermediate color. That would be more like a Bezier curve or something.
Conscience is the debugger of the mind

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #38 on: August 01, 2016, 10:16:37 am »
Thank you Circular, i will give it a try to see if i can gain what i want with changing the manipulating function for drawing the gradient for example, or other ways.

Sanem

  • Full Member
  • ***
  • Posts: 173
Re: BGRAbitmap Gradient
« Reply #39 on: August 01, 2016, 10:18:25 am »
This discussion is being continued in this thread:
http://forum.lazarus.freepascal.org/index.php/topic,33557.0.html

Any Help or idea appreciated prior
Regards

 

TinyPortal © 2005-2018