Ignore:
Timestamp:
Dec 4, 2023, 9:42:30 PM (12 months ago)
Author:
chronos
Message:
  • Fixed: Build under Windows.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/DpiControls/Dpi.Common.pas

    r473 r475  
    44
    55uses
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
    67  Classes, SysUtils, LCLType, Types, LCLIntf, Graphics, Dpi.Graphics;
    78
     
    910  DpiControlsComponentPaletteName = 'DpiControls';
    1011
    11 function BitBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
    12 function BitBltCanvas(Dest: TCanvas; X, Y, Width, Height: Integer; Src: TCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
     12function BitBlt(DestDC: HDC; X, Y, Width, Height: Integer; SrcDC: HDC; XSrc,
     13    YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
     14function BitBltCanvas(Dest: TCanvas; X, Y, Width, Height: Integer; Src: TCanvas;
     15    XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
    1316function CreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN;
     17function ScrollDC(hDC: HDC; dx: longint; dy: longint; const lprcScroll: RECT;
     18  const lprcClip:RECT;hrgnUpdate:HRGN; lprcUpdate: LPRECT): WINBOOL; overload;
    1419function ScrollDC(Canvas: TCanvas; dx: Longint; dy: Longint; const lprcScroll: TRect;
    15   const lprcClip:TRect; hrgnUpdate: Handle; lprcUpdate: PRect): Boolean;
     20  const lprcClip:TRect; hrgnUpdate: Handle; lprcUpdate: PRect): Boolean; overload;
    1621function ScaleToNative(Value: Integer): Integer;
    1722function ScaleToNativeDist(Base, Value: Integer): Integer;
     
    4449  Result := LCLIntf.CreateRectRgn(ScaleToNative(X1), ScaleToNative(Y1), ScaleToNative(X2),
    4550    ScaleToNative(Y2));
     51end;
     52
     53function ScrollDC(hDC: HDC; dx: longint; dy: longint; const lprcScroll: RECT;
     54  const lprcClip: RECT; hrgnUpdate: HRGN; lprcUpdate: LPRECT): WINBOOL;
     55var
     56  R: RECT;
     57begin
     58  if Assigned(lprcUpdate) then begin
     59    R := ScaleRectToNative(lprcUpdate^);
     60    lprcUpdate := @R;
     61  end;
     62  Result := Windows.ScrollDC(hDC, ScaleToNative(dx), ScaleToNative(dY),
     63    ScaleRectToNative(lprcScroll), ScaleRectToNative(lprcClip), hrgnUpdate, lprcUpdate);
    4664end;
    4765
Note: See TracChangeset for help on using the changeset viewer.