Ignore:
Timestamp:
Jan 6, 2024, 12:07:04 AM (11 months ago)
Author:
chronos
Message:
  • Fixed: Make fractional scaling work also on Windows.
  • Modified: By default use system DPI setting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r515 r518  
    892892begin
    893893  {$IFDEF WINDOWS}
    894   // LCLIntf.BitBlt is slower than direct Windows BitBlt
    895   Result := Windows.BitBlt(DestCanvas.Handle, ScaleToNative(X), ScaleToNative(Y),
    896     ScaleToNative(Width), ScaleToNative(Height), SrcCanvas.Handle,
    897     ScaleToNative(XSrc), ScaleToNative(YSrc), Rop);
     894    {$IFDEF DPI}
     895    Result := BitBlt(DestCanvas.Handle, X, Y, Width, Height, SrcCanvas.Handle, XSrc, YSrc, Rop);
     896    {$ELSE}
     897    // LCLIntf.BitBlt is slower than direct Windows BitBlt
     898    Result := Windows.BitBlt(DestCanvas.Handle, ScaleToNative(X), ScaleToNative(Y),
     899      ScaleToNative(Width), ScaleToNative(Height), SrcCanvas.Handle,
     900      ScaleToNative(XSrc), ScaleToNative(YSrc), Rop);
     901    {$ENDIF}
    898902  {$ELSE}
    899903  Result := BitBlt(DestCanvas.Handle, X, Y, Width, Height, SrcCanvas.Handle, XSrc, YSrc, Rop);
     
    17881792    {$IFDEF DPI}
    17891793    if CustomDpiEnabled then Screen.Dpi := CustomDpi
    1790       else Screen.Dpi := 96; //Screen.GetSystemDpi;
     1794      else Screen.Dpi := Screen.GetSystemDpi;
    17911795    {$ENDIF}
    17921796  finally
Note: See TracChangeset for help on using the changeset viewer.