Ignore:
Timestamp:
Dec 22, 2016, 8:49:19 PM (7 years ago)
Author:
chronos
Message:
  • Modified: Updated BGRABitmap package.
File:
1 edited

Legend:

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

    r472 r494  
    22
    33{$mode objfpc}{$H+}
    4 
     4{$i bgrabitmap.inc}
    55{$i bgrasse.inc}
    66
     
    1010
    1111uses
    12   Classes, Graphics, BGRABitmapTypes, BGRABitmap, BGRABlend, BGRAPhongTypes, BGRASSE;
    13 
    14 { Creates a bitmap with the specified text horizontally centered and with a shadow }
     12  Classes, BGRAGraphics, BGRABitmapTypes, BGRABitmap, BGRABlend, BGRAPhongTypes, BGRASSE;
     13
     14{$IFDEF BGRABITMAP_USE_LCL}{ Creates a bitmap with the specified text horizontally centered and with a shadow }
    1515function TextShadow(AWidth,AHeight: Integer; AText: String; AFontHeight: Integer; ATextColor,AShadowColor: TBGRAPixel;
    1616  AOffSetX,AOffSetY: Integer; ARadius: Integer = 0; AFontStyle: TFontStyles = []; AFontName: String = 'Default'; AShowText: Boolean = True): TBGRABitmap;
     17{$ENDIF}
    1718
    1819{----------------------------------------------------------------------}
     
    176177implementation
    177178
    178 uses GraphType, Types, SysUtils, BGRATextFX; {GraphType unit used by phongdraw.inc}
    179 
    180 function TextShadow(AWidth, AHeight: Integer; AText: String;
     179uses Types, SysUtils{$IFDEF BGRABITMAP_USE_LCL}, BGRATextFX{$ENDIF}; {GraphType unit used by phongdraw.inc}
     180
     181{$IFDEF BGRABITMAP_USE_LCL}function TextShadow(AWidth, AHeight: Integer; AText: String;
    181182  AFontHeight: Integer; ATextColor, AShadowColor: TBGRAPixel; AOffSetX,
    182183  AOffSetY: Integer; ARadius: Integer; AFontStyle: TFontStyles;
     
    184185begin
    185186  result := BGRATextFX.TextShadow(AWidth,AHeight,AText,AFontHeight,ATextColor,AShadowColor,AOffsetX,AOffsetY,ARadius,AFontStyle,AFontName,AShowText) as TBGRABitmap;
    186 end;
     187end;{$ENDIF}
    187188
    188189function nGradientInfo(StartColor, StopColor: TBGRAPixel;
     
    671672  //antialiased border
    672673  mask := TBGRABitmap.Create(width,height,BGRABlack);
    673   mask.FillPolyAntialias([PointF(rx,-0.5),PointF(0,height-0.5),PointF(width-0.5,height-0.5)],BGRAWhite);
     674  mask.FillPolyAntialias([PointF(width/2,-0.5),PointF(0,height-0.5),PointF(width-0.5,height-0.5)],BGRAWhite);
    674675  result.ApplyMask(mask);
    675676  mask.Free;
Note: See TracChangeset for help on using the changeset viewer.