Changeset 405 for branches/highdpi/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- Nov 3, 2021, 11:22:02 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/CevoComponents/ScreenTools.pas
r378 r405 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: TDpiBitmap;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; … … 1835 1808 end; 1836 1809 1837 { TTexture }1838 1839 procedure TTexture.SetAge(AValue: Integer);1840 begin1841 if FAge = AValue then Exit;1842 FAge := AValue;1843 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator +1844 'Texture' + IntToStr(Age + 1) + '.jpg');1845 ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight];1846 ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];1847 ColorTextLight := Colors.Canvas.Pixels[clkAge0 + Age, cliTextLight];1848 ColorTextShade := Colors.Canvas.Pixels[clkAge0 + Age, cliTextShade];1849 ColorLitText := Colors.Canvas.Pixels[clkAge0 + Age, cliLitText];1850 ColorMark := Colors.Canvas.Pixels[clkAge0 + Age, cliMark];1851 ColorPage := Colors.Canvas.Pixels[clkAge0 + Age, cliPage];1852 ColorCover := Colors.Canvas.Pixels[clkAge0 + Age, cliCover];1853 end;1854 1855 function TTexture.GetHeight: Integer;1856 begin1857 Result := Image.Height;1858 end;1859 1860 function TTexture.GetWidth: Integer;1861 begin1862 Result := Image.Width;1863 end;1864 1865 constructor TTexture.Create;1866 begin1867 Image := TDpiBitmap.Create;1868 FAge := -2;1869 end;1870 1871 destructor TTexture.Destroy;1872 begin1873 FreeAndNil(Image);1874 inherited;1875 end;1876 1877 procedure TTexture.Assign(Source: TTexture);1878 begin1879 FAge := Source.FAge;1880 Image.Assign(Image);1881 ColorBevelLight := Source.ColorBevelLight;1882 ColorBevelShade := Source.ColorBevelShade;1883 ColorTextLight := Source.ColorTextLight;1884 ColorTextShade := Source.ColorTextShade;1885 ColorLitText := Source.ColorLitText;1886 ColorMark := Source.ColorMark;1887 ColorPage := Source.ColorPage;1888 ColorCover := Source.ColorCover;1889 end;1890 1891 1810 end.
Note:
See TracChangeset
for help on using the changeset viewer.