Changeset 494 for GraphicTest/Packages/bgrabitmap/bgragradients.pas
- Timestamp:
- Dec 22, 2016, 8:49:19 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Packages/bgrabitmap/bgragradients.pas
r472 r494 2 2 3 3 {$mode objfpc}{$H+} 4 4 {$i bgrabitmap.inc} 5 5 {$i bgrasse.inc} 6 6 … … 10 10 11 11 uses 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 } 15 15 function TextShadow(AWidth,AHeight: Integer; AText: String; AFontHeight: Integer; ATextColor,AShadowColor: TBGRAPixel; 16 16 AOffSetX,AOffSetY: Integer; ARadius: Integer = 0; AFontStyle: TFontStyles = []; AFontName: String = 'Default'; AShowText: Boolean = True): TBGRABitmap; 17 {$ENDIF} 17 18 18 19 {----------------------------------------------------------------------} … … 176 177 implementation 177 178 178 uses GraphType, Types, SysUtils, BGRATextFX; {GraphType unit used by phongdraw.inc}179 180 function TextShadow(AWidth, AHeight: Integer; AText: String;179 uses 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; 181 182 AFontHeight: Integer; ATextColor, AShadowColor: TBGRAPixel; AOffSetX, 182 183 AOffSetY: Integer; ARadius: Integer; AFontStyle: TFontStyles; … … 184 185 begin 185 186 result := BGRATextFX.TextShadow(AWidth,AHeight,AText,AFontHeight,ATextColor,AShadowColor,AOffsetX,AOffsetY,ARadius,AFontStyle,AFontName,AShowText) as TBGRABitmap; 186 end; 187 end;{$ENDIF} 187 188 188 189 function nGradientInfo(StartColor, StopColor: TBGRAPixel; … … 671 672 //antialiased border 672 673 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); 674 675 result.ApplyMask(mask); 675 676 mask.Free;
Note:
See TracChangeset
for help on using the changeset viewer.