Ignore:
Timestamp:
Apr 9, 2015, 9:58:36 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: Use csOpaque control style also to Image, PaintBox and OpenGLControl.
  • Modified: Change size of test frame with SpinEdits as delayed using timer.
  • Updated: BRGABitmap package to version 8.1.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest/Packages/bgrabitmap/bgragradientscanner.pas

    r452 r472  
    108108  end;
    109109
     110  { TBGRAConstantScanner }
     111
     112  TBGRAConstantScanner = class(TBGRAGradientScanner)
     113    constructor Create(c: TBGRAPixel);
     114  end;
     115
     116  { TBGRARandomScanner }
     117
     118  TBGRARandomScanner = class(TBGRACustomScanner)
     119  private
     120    FOpacity: byte;
     121    FGrayscale: boolean;
     122  public
     123    constructor Create(AGrayscale: Boolean; AOpacity: byte);
     124    function ScanAtInteger({%H-}X, {%H-}Y: integer): TBGRAPixel; override;
     125    function ScanNextPixel: TBGRAPixel; override;
     126    function ScanAt({%H-}X, {%H-}Y: Single): TBGRAPixel; override;
     127  end;
     128
    110129  { TBGRAGradientTriangleScanner }
    111130
     
    184203
    185204uses BGRABlend;
     205
     206{ TBGRAConstantScanner }
     207
     208constructor TBGRAConstantScanner.Create(c: TBGRAPixel);
     209begin
     210  inherited Create(c,c,gtLinear,PointF(0,0),PointF(0,0),false);
     211end;
     212
     213{ TBGRARandomScanner }
     214
     215constructor TBGRARandomScanner.Create(AGrayscale: Boolean; AOpacity: byte);
     216begin
     217  FGrayscale:= AGrayscale;
     218  FOpacity:= AOpacity;
     219end;
     220
     221function TBGRARandomScanner.ScanAtInteger(X, Y: integer): TBGRAPixel;
     222begin
     223  Result:=ScanNextPixel;
     224end;
     225
     226function TBGRARandomScanner.ScanNextPixel: TBGRAPixel;
     227begin
     228  if FGrayscale then
     229  begin
     230    result.red := random(256);
     231    result.green := result.red;
     232    result.blue := result.red;
     233    result.alpha:= FOpacity;
     234  end else
     235    Result:= BGRA(random(256),random(256),random(256),FOpacity);
     236end;
     237
     238function TBGRARandomScanner.ScanAt(X, Y: Single): TBGRAPixel;
     239begin
     240  Result:=ScanNextPixel;
     241end;
    186242
    187243{ TBGRAHueGradient }
     
    758814  InitScanInline(X,Y);
    759815  if FVertical then
    760     FHorizColor := ScanAt(X,Y);
     816    FHorizColor := ScanNextInline;
    761817end;
    762818
     
    12471303end;
    12481304
     1305initialization
     1306
     1307  Randomize;
     1308
    12491309end.
    12501310
Note: See TracChangeset for help on using the changeset viewer.