Changeset 252 for branches/highdpi/Packages/DpiControls/UDpiControls.pas
- Timestamp:
- May 23, 2020, 12:45:14 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r250 r252 902 902 function DpiBitBltCanvas(Dest: TDpiCanvas; X, Y, Width, Height: Integer; Src: TDpiCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; 903 903 function DpiCreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN; 904 function DpiScrollDC(hDC:HDC; dx:longint; dy:longint; const lprcScroll:RECT; const lprcClip:RECT;hrgnUpdate:HRGN; lprcUpdate: LPRECT): WINBOOL; 904 905 function ScaleToNative(Value: Integer): Integer; 905 906 function ScaleFromNative(Value: Integer): Integer; … … 940 941 Result := CreateRectRgn(ScaleToNative(X1), ScaleToNative(Y1), ScaleToNative(X2), 941 942 ScaleToNative(Y2)); 943 end; 944 945 {$IFDEF LINUX} 946 function LinuxScrollDC(Canvas: TDpiCanvas; dx: longint; dy: longint; const lprcScroll:TRect; const lprcClip:TRect; hrgnUpdate:HRGN; lprcUpdate: PRect):Boolean; 947 begin 948 end; 949 {$ENDIF} 950 951 function DpiScrollDC(hDC: HDC; dx: longint; dy: longint; 952 const lprcScroll: RECT; const lprcClip: RECT; hrgnUpdate: HRGN; 953 lprcUpdate: LPRECT): WINBOOL; 954 begin 955 {$IFDEF WINDOWS} 956 Result := Windows.ScrollDC(hDC, ScaleToNative(dx), ScaleToNative(dy), 957 ScaleRectToNative(lprcScroll), ScaleRectToNative(lprcClip), 958 hrgnUpdate, lprcUpdate); 959 {$ENDIF} 960 {$IFDEF LINUX} 961 // Can't do scrolling of DC under Linux, then fallback into BitBlt. 962 Result := DpiBitCanvas(Canvas, lprcScroll.Left + dx, lprcScroll.Top + dy, lprcScroll.Right - lprcScroll.Left, lprcScroll.Bottom - lprcScroll.Top, 963 Canvas, lprcScroll.Left, lprcScroll.Top); 964 {$ENDIF} 942 965 end; 943 966
Note:
See TracChangeset
for help on using the changeset viewer.