Changeset 380 for trunk/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- Apr 25, 2021, 10:39:00 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r375 r380 8 8 {$ENDIF} 9 9 StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math, 10 Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils ;10 Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils, UTexture; 11 11 12 12 type 13 14 { TTexture }15 16 TTexture = class17 private18 FAge: Integer;19 function GetHeight: Integer;20 function GetWidth: Integer;21 procedure SetAge(AValue: Integer);22 public23 Image: TBitmap;24 ColorBevelLight: TColor;25 ColorBevelShade: TColor;26 ColorTextLight: TColor;27 ColorTextShade: TColor;28 ColorLitText: TColor;29 ColorMark: TColor;30 ColorPage: TColor;31 ColorCover: TColor;32 constructor Create;33 destructor Destroy; override;34 procedure Assign(Source: TTexture);35 property Age: Integer read FAge write SetAge;36 property Width: Integer read GetWidth;37 property Height: Integer read GetHeight;38 end;39 40 13 TLoadGraphicFileOption = (gfNoError, gfNoGamma); 41 14 TLoadGraphicFileOptions = set of TLoadGraphicFileOption; … … 1844 1817 end; 1845 1818 1846 { TTexture }1847 1848 procedure TTexture.SetAge(AValue: Integer);1849 begin1850 if FAge = AValue then Exit;1851 FAge := AValue;1852 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +1853 'Texture' + IntToStr(Age + 1) + '.jpg');1854 ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];1855 ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];1856 ColorTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];1857 ColorTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];1858 ColorLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];1859 ColorMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];1860 ColorPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];1861 ColorCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];1862 end;1863 1864 function TTexture.GetHeight: Integer;1865 begin1866 Result := Image.Height;1867 end;1868 1869 function TTexture.GetWidth: Integer;1870 begin1871 Result := Image.Width;1872 end;1873 1874 constructor TTexture.Create;1875 begin1876 Image := TBitmap.Create;1877 FAge := -2;1878 end;1879 1880 destructor TTexture.Destroy;1881 begin1882 FreeAndNil(Image);1883 inherited;1884 end;1885 1886 procedure TTexture.Assign(Source: TTexture);1887 begin1888 FAge := Source.FAge;1889 Image.Assign(Image);1890 ColorBevelLight := Source.ColorBevelLight;1891 ColorBevelShade := Source.ColorBevelShade;1892 ColorTextLight := Source.ColorTextLight;1893 ColorTextShade := Source.ColorTextShade;1894 ColorLitText := Source.ColorLitText;1895 ColorMark := Source.ColorMark;1896 ColorPage := Source.ColorPage;1897 ColorCover := Source.ColorCover;1898 end;1899 1900 1819 end.
Note:
See TracChangeset
for help on using the changeset viewer.