Ignore:
Timestamp:
Nov 3, 2021, 11:22:02 AM (3 years ago)
Author:
chronos
Message:
  • Modified: Merged changes from trunk r404.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/ScreenTools.pas

    r378 r405  
    88  {$ENDIF}
    99  StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math,
    10   Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils;
     10  Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils, UTexture;
    1111
    1212type
    13 
    14   { TTexture }
    15 
    16   TTexture = class
    17   private
    18     FAge: Integer;
    19     function GetHeight: Integer;
    20     function GetWidth: Integer;
    21     procedure SetAge(AValue: Integer);
    22   public
    23     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 
    4013  TLoadGraphicFileOption = (gfNoError, gfNoGamma);
    4114  TLoadGraphicFileOptions = set of TLoadGraphicFileOption;
     
    18351808end;
    18361809
    1837 { TTexture }
    1838 
    1839 procedure TTexture.SetAge(AValue: Integer);
    1840 begin
    1841   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 begin
    1857   Result := Image.Height;
    1858 end;
    1859 
    1860 function TTexture.GetWidth: Integer;
    1861 begin
    1862   Result := Image.Width;
    1863 end;
    1864 
    1865 constructor TTexture.Create;
    1866 begin
    1867   Image := TDpiBitmap.Create;
    1868   FAge := -2;
    1869 end;
    1870 
    1871 destructor TTexture.Destroy;
    1872 begin
    1873   FreeAndNil(Image);
    1874   inherited;
    1875 end;
    1876 
    1877 procedure TTexture.Assign(Source: TTexture);
    1878 begin
    1879   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 
    18911810end.
Note: See TracChangeset for help on using the changeset viewer.