Changeset 514 for trunk/Packages/CevoComponents
- Timestamp:
- Jan 3, 2024, 3:05:32 PM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r512 r514 97 97 T: TTexture); 98 98 procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer); 99 procedure DrawBufferEnsureSize(Width, Height: Integer); 99 100 procedure LoadPhrases; 100 101 procedure Texturize(Dest, Texture: TBitmap; TransparentColor: Cardinal); … … 190 191 Paper: TBitmap; 191 192 BigImp: TBitmap; 192 LogoBuffer: TBitmap;193 DrawBuffer: TBitmap; 193 194 FullScreen: Boolean; 194 195 GenerateNames: Boolean; … … 1567 1568 procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer); 1568 1569 begin 1569 if not Assigned(LogoBuffer) then Exit; 1570 UnshareBitmap(LogoBuffer); 1571 BitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y); 1572 ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), Logo.BoundsRect, 1570 if not Assigned(DrawBuffer) then Exit; 1571 DrawBufferEnsureSize(Logo.Width, Logo.Height); 1572 UnshareBitmap(DrawBuffer); 1573 BitBltCanvas(DrawBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y); 1574 ImageOp_BCC(DrawBuffer, Templates.Data, Point(0, 0), Logo.BoundsRect, 1573 1575 LightColor, ShadeColor); 1574 BitBltCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0); 1576 BitBltCanvas(Canvas, X, Y, Logo.Width, Logo.Height, DrawBuffer.Canvas, 0, 0); 1577 end; 1578 1579 procedure DrawBufferEnsureSize(Width, Height: Integer); 1580 begin 1581 if (DrawBuffer.Width >= Width) and (DrawBuffer.Height >= Height) then Exit; 1582 if (DrawBuffer.Width < Width) and (DrawBuffer.Height < Height) then 1583 DrawBuffer.SetSize(Width, Height) 1584 else if DrawBuffer.Width < Width then DrawBuffer.Width := Width 1585 else if DrawBuffer.Height < Height then DrawBuffer.Height := Height; 1586 DrawBuffer.Canvas.FillRect(0, 0, DrawBuffer.Width, DrawBuffer.Height); 1575 1587 end; 1576 1588 … … 1813 1825 end; 1814 1826 1815 if not Assigned(LogoBuffer) then begin1816 LogoBuffer := TBitmap.Create;1817 LogoBuffer.PixelFormat := TPixelFormat.pf24bit;1818 LogoBuffer.SetSize(BigBook.Width, BigBook.Height);1819 end;1820 1821 1827 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors.png'); 1822 1828 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper.jpg'); … … 1838 1844 for Section := Low(TFontType) to High(TFontType) do 1839 1845 UniFont[Section] := TFont.Create; 1846 1847 DrawBuffer := TBitmap.Create; 1848 DrawBuffer.PixelFormat := TPixelFormat.pf24bit; 1840 1849 1841 1850 GrExt := TGraphicSets.Create; … … 1877 1886 FreeAndNil(Phrases); 1878 1887 FreeAndNil(Phrases2); 1879 if Assigned(LogoBuffer) then FreeAndNil(LogoBuffer);1888 FreeAndNil(DrawBuffer); 1880 1889 FreeAndNil(BigImp); 1881 1890 FreeAndNil(Paper);
Note:
See TracChangeset
for help on using the changeset viewer.