Changeset 468 for trunk/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- Dec 3, 2023, 11:28:08 AM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r456 r468 7 7 Windows, 8 8 {$ENDIF} 9 StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math, 10 Forms, Menus, GraphType, GraphicSet, LazFileUtils, Texture; 9 StringTables, LCLIntf, LCLType, SysUtils, Classes, Math, 10 GraphType, GraphicSet, LazFileUtils, Texture, 11 {$IFDEF DPI}Dpi.Forms, Dpi.Menus, Dpi.Graphics, Dpi.Controls, Dpi.Common{$ELSE} 12 Forms, Menus, Graphics, Controls{$ENDIF}; 11 13 12 14 type … … 96 98 procedure Texturize(Dest, Texture: TBitmap; TransparentColor: Cardinal); 97 99 procedure DarkenImage(Bitmap: TBitmap; Change: Integer); 100 {$IFNDEF DPI} 98 101 function ScaleToNative(Value: Integer): Integer; 99 102 function ScaleFromNative(Value: Integer): Integer; 103 {$ENDIF} 100 104 procedure UnshareBitmap(Bitmap: TBitmap); 101 105 procedure Gtk2Fix; … … 199 203 200 204 uses 201 Directories, Sound, PixelPointer; 205 {$IFDEF DPI}Dpi.PixelPointer,{$ELSE}PixelPointer,{$ENDIF} 206 Directories, Sound; 202 207 203 208 var … … 419 424 Jpeg.LoadFromFile(FileName); 420 425 if not (gfNoGamma in Options) then 421 Bmp.PixelFormat := pf24bit;426 Bmp.PixelFormat := TPixelFormat.pf24bit; 422 427 Bmp.SetSize(Jpeg.Width, Jpeg.Height); 423 428 Bmp.Canvas.Draw(0, 0, Jpeg); … … 434 439 Png.LoadFromFile(FileName); 435 440 if not (gfNoGamma in Options) then 436 Bmp.PixelFormat := pf24bit;441 Bmp.PixelFormat := TPixelFormat.pf24bit; 437 442 Bmp.SetSize(Png.Width, Png.Height); 438 443 if (Png.RawImage.Description.Format = ricfGray) then 439 444 begin 440 445 // LCL doesn't support 8-bit colors properly. Use 24-bit instead. 441 Bmp.PixelFormat := pf24bit;446 Bmp.PixelFormat := TPixelFormat.pf24bit; 442 447 CopyGray8BitTo24bitBitmap(Bmp, Png); 443 448 end … … 454 459 Bmp.LoadFromFile(FileName); 455 460 if not (gfNoGamma in Options) then 456 Bmp.PixelFormat := pf24bit;461 Bmp.PixelFormat := TPixelFormat.pf24bit; 457 462 Result := True; 458 463 except … … 634 639 Height := ScaleToNative(Height); 635 640 //Assert(Src.PixelFormat = pf8bit); 636 Assert(dst.PixelFormat = pf24bit);641 Assert(dst.PixelFormat = TPixelFormat.pf24bit); 637 642 if xDst < 0 then begin 638 643 Width := Width + xDst; … … 821 826 Height := ScaleToNative(Height); 822 827 bmp.BeginUpdate; 823 Assert(bmp.PixelFormat = pf24bit);828 Assert(bmp.PixelFormat = TPixelFormat.pf24bit); 824 829 Height := Y + Height; 825 830 PixelPtr := TPixelPointer.Create(Bmp, X, Y); … … 1524 1529 Brush.Color := $000000; 1525 1530 FillRect(Rect(X + Pos + abs(Growth), Y, X + Max, Y + 7)); 1526 Brush.Style := bsClear;1531 Brush.Style := TBrushStyle.bsClear; 1527 1532 end; 1528 1533 end; … … 1627 1632 end; 1628 1633 1634 {$IFNDEF DPI} 1629 1635 function ScaleToNative(Value: Integer): Integer; 1630 1636 begin … … 1636 1642 Result := Value; 1637 1643 end; 1644 {$ENDIF} 1638 1645 1639 1646 procedure UnshareBitmap(Bitmap: TBitmap); … … 1691 1698 Size := Size * 10 + Byte(S[I]) - 48; 1692 1699 'B', 'b': 1693 UniFont[section].Style := UniFont[section].Style + [ fsBold];1700 UniFont[section].Style := UniFont[section].Style + [TFontStyle.fsBold]; 1694 1701 'I', 'i': 1695 UniFont[section].Style := UniFont[section].Style + [ fsItalic];1702 UniFont[section].Style := UniFont[section].Style + [TFontStyle.fsItalic]; 1696 1703 end; 1697 UniFont[section].Size := Round(Size * 72/ UniFont[section].PixelsPerInch);1704 UniFont[section].Size := Round(Size * ScaleToNative(72) / UniFont[section].PixelsPerInch); 1698 1705 end; 1699 1706 end; … … 1783 1790 1784 1791 Colors := TBitmap.Create; 1785 Colors.PixelFormat := pf24bit;1792 Colors.PixelFormat := TPixelFormat.pf24bit; 1786 1793 Paper := TBitmap.Create; 1787 Paper.PixelFormat := pf24bit;1794 Paper.PixelFormat := TPixelFormat.pf24bit; 1788 1795 BigImp := TBitmap.Create; 1789 BigImp.PixelFormat := pf24bit;1796 BigImp.PixelFormat := TPixelFormat.pf24bit; 1790 1797 MainTexture := TTexture.Create; 1791 1798 ClickFrameColor := HGrSystem.Data.Canvas.Pixels[187, 175]; … … 1796 1803 1797 1804 LogoBuffer := TBitmap.Create; 1798 LogoBuffer.PixelFormat := pf24bit;1805 LogoBuffer.PixelFormat := TPixelFormat.pf24bit; 1799 1806 LogoBuffer.SetSize(BigBook.Width, BigBook.Height); 1800 1807 end;
Note:
See TracChangeset
for help on using the changeset viewer.