Changeset 518 for trunk/Packages/DpiControls
- Timestamp:
- Jan 6, 2024, 12:07:04 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/DpiControls/Dpi.Common.pas
r516 r518 186 186 SrcWidth, SrcHeight: Integer; 187 187 begin 188 {$IFDEF WINDOWS}189 // LCLIntf.BitBlt is slower than direct Windows BitBlt190 Result := Windows.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y),191 ScaleToNative(Width), ScaleToNative(Height), SrcDC,192 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop);193 {$ELSE}194 195 188 DstWidth := ScaleToNativeDist(X, Width); 196 189 DstHeight := ScaleToNativeDist(Y, Height); 197 190 SrcWidth := ScaleToNativeDist(XSrc, Width); 198 191 SrcHeight := ScaleToNativeDist(YSrc, Height); 192 199 193 if (DstWidth = SrcWidth) and (DstHeight = SrcHeight) then begin 194 {$IFDEF WINDOWS} 195 // On Windows LCLIntf.BitBlt is slower than direct Windows BitBlt 196 Result := Windows.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 197 DstWidth, DstHeight, SrcDC, 198 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 199 {$ELSE} 200 200 Result := LCLIntf.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 201 201 DstWidth, DstHeight, SrcDC, 202 202 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 203 {$ENDIF} 203 204 end else begin 205 {$IFDEF WINDOWS} 206 // On Windows LCLIntf.BitBlt is slower than direct Windows BitBlt 207 Result := Windows.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 208 Min(SrcWidth, DstWidth), Min(DstHeight, SrcHeight), SrcDC, 209 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 210 211 // Instead calling StretchBlt for entire region try to draw missing part with BitBlt 212 if DstWidth > SrcWidth then begin 213 Windows.BitBlt(DestDC, ScaleToNative(X) + SrcWidth, ScaleToNative(Y), 214 DstWidth - SrcWidth, DstHeight, SrcDC, 215 ScaleToNative(XSrc) + SrcWidth - (DstWidth - SrcWidth), ScaleToNative(YSrc), Rop); 216 end; 217 if DstHeight > SrcHeight then begin 218 Windows.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y) + SrcHeight, 219 DstWidth, DstHeight - SrcHeight, SrcDC, 220 ScaleToNative(XSrc), ScaleToNative(YSrc) + SrcHeight - (DstHeight - SrcHeight), Rop); 221 end; 222 {$ELSE} 204 223 Result := LCLIntf.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 205 SrcWidth, SrcHeight, SrcDC,224 Min(SrcWidth, DstWidth), Min(DstHeight, SrcHeight), SrcDC, 206 225 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 207 226 … … 217 236 ScaleToNative(XSrc), ScaleToNative(YSrc) + SrcHeight - (DstHeight - SrcHeight), Rop); 218 237 end; 219 { Result := LCLIntf.StretchBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 220 DstWidth, DstHeight, SrcDC, 221 ScaleToNative(XSrc), ScaleToNative(YSrc), 222 SrcWidth, SrcHeight, Rop);} 238 {$ENDIF} 223 239 end; 224 225 { Result := LCLIntf.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y),226 ScaleToNative(Width), ScaleToNative(Height), SrcDC,227 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop);228 }229 {$ENDIF}230 240 end; 231 241
Note:
See TracChangeset
for help on using the changeset viewer.