- Timestamp:
- May 21, 2020, 10:30:59 PM (5 years ago)
- Location:
- branches/highdpi
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/highdpi/Integrated.lpi
r246 r247 16 16 <ResourceType Value="res"/> 17 17 <UseXPManifest Value="True"/> 18 <XPManifest> 19 <DpiAware Value="True"/> 20 </XPManifest> 18 21 <Icon Value="0"/> 19 22 <Resources Count="2"> -
branches/highdpi/LocalPlayer/Help.pas
r246 r247 443 443 MaxSum = 9 * 9 * 255 * 75 div 100; 444 444 var 445 x, y, dx, dy, xSrc, ySrc, sum, xx: integer;445 x, y, dx, dy, xSrc, ySrc, Sum, xx: integer; 446 446 Heaven: array [0..nHeaven] of integer; 447 PaintPtr, CoalPtr: TPixelPointer; 447 PaintPtr: TPixelPointer; 448 CoalPtr: TPixelPointer; 448 449 ImpPtr: array [-1..1] of TPixelPointer; 449 450 begin … … 457 458 xSrc := iix mod 7 * xSizeBig; 458 459 ySrc := (iix div 7 + 1) * ySizeBig; 459 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do 460 PaintPtr := PixelPointer(OffScreen, ScaleToNative(x0), ScaleToNative(y0)); 461 CoalPtr := PixelPointer(Templates, ScaleToNative(xCoal), ScaleToNative(yCoal)); 462 for dy := -1 to 1 do 463 ImpPtr[dy] := PixelPointer(BigImp, ScaleToNative(xSrc), ScaleToNative(ySrc)); 464 for y := 0 to ScaleToNative(ySizeBig) * 2 - 1 do begin 460 465 if ((ScaleToNative(y0) + y) >= 0) and ((ScaleToNative(y0) + y) < ScaleToNative(InnerHeight)) then begin 461 PaintPtr := PixelPointer(OffScreen, 0, ScaleToNative(y0) + y);462 CoalPtr := PixelPointer(Templates, 0, ScaleToNative(yCoal) + y);463 466 for dy := -1 to 1 do 464 467 if ((Max(y + ScaleToNative(dy), 0) shr 1) >= 0) and ((Max(y + ScaleToNative(dy), 0) shr 1) < ScaleToNative(ySizeBig)) then 465 ImpPtr[dy] := PixelPointer(BigImp, 0, ScaleToNative(ySrc) + (Max(y + ScaleToNative(dy), 0) shr 1));466 for x := 0 to ScaleToNative(xSizeBig ) * 2- 1 do begin467 sum := 0;468 ImpPtr[dy].SetXY(0, Max(y + ScaleToNative(dy), 0) shr 1); 469 for x := 0 to ScaleToNative(xSizeBig * 2) - 1 do begin 470 Sum := 0; 468 471 for dx := -1 to 1 do begin 469 xx := ScaleToNative(xSrc) +Max((x + ScaleToNative(dx)), 0) shr 1;472 xx := Max((x + ScaleToNative(dx)), 0) shr 1; 470 473 for dy := -1 to 1 do begin 471 474 ImpPtr[dy].SetX(xx); … … 475 478 (ImpPtr[dy].Pixel^.B shl 16 + ImpPtr[dy].Pixel^.G shl 8 + 476 479 ImpPtr[dy].Pixel^.R = Heaven[(ScaleFromNative(y) + dy) shr 1]) then 477 sum := sum + 9 * 255480 Sum := Sum + 9 * 255 478 481 else 479 sum := sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 *482 Sum := Sum + ImpPtr[dy].Pixel^.B + 5 * ImpPtr[dy].Pixel^.G + 3 * 480 483 ImpPtr[dy].Pixel^.R; 481 484 end; 482 485 end; 483 if sum < MaxSum then begin // no saturation 484 CoalPtr.SetX(ScaleToNative(xCoal) + x); 485 sum := 1 shl 22 - (MaxSum - sum) * (256 - CoalPtr.Pixel^.B * 2); 486 PaintPtr.SetX(x0 + x); 487 PaintPtr.Pixel^.B := PaintPtr.Pixel^.B * sum shr 22; 488 PaintPtr.Pixel^.G := PaintPtr.Pixel^.G * sum shr 22; 489 PaintPtr.Pixel^.R := PaintPtr.Pixel^.R * sum shr 22; 486 if Sum < MaxSum then begin // no saturation 487 Sum := 1 shl 22 - (MaxSum - Sum) * (256 - CoalPtr.Pixel^.B * 2); 488 PaintPtr.Pixel^.B := Min(PaintPtr.Pixel^.B * Sum shr 22, 255); 489 PaintPtr.Pixel^.G := Min(PaintPtr.Pixel^.G * Sum shr 22, 255); 490 PaintPtr.Pixel^.R := Min(PaintPtr.Pixel^.R * Sum shr 22, 255); 490 491 end; 492 PaintPtr.NextPixel; 493 CoalPtr.NextPixel; 491 494 end; 492 495 end; 496 PaintPtr.NextLine; 497 CoalPtr.NextLine; 498 end; 493 499 Offscreen.EndUpdate; 494 500 BigImp.EndUpdate; -
branches/highdpi/Packages/CevoComponents/ScreenTools.pas
r246 r247 820 820 {$IFDEF WINDOWS} 821 821 // LCLIntf.BitBlt is slower than direct Windows BitBlt 822 Result := Windows.DpiBitBlt(DestCanvas.Handle, X, Y, Width, Height, SrcCanvas.Handle, XSrc, YSrc, Rop);822 Result := DpiBitBlt(DestCanvas.Handle, X, Y, Width, Height, SrcCanvas.Handle, XSrc, YSrc, Rop); 823 823 {$ELSE} 824 824 Result := DpiBitBlt(DestCanvas.Handle, X, Y, Width, Height, SrcCanvas.Handle, XSrc, YSrc, Rop); -
branches/highdpi/Packages/DpiControls/UDpiControls.pas
r246 r247 6 6 7 7 uses 8 Classes, SysUtils, LCLProc, LResources, Forms, FormEditingIntf, ProjectIntf,8 Windows, Classes, SysUtils, LCLProc, LResources, Forms, FormEditingIntf, ProjectIntf, 9 9 Controls, StdCtrls, fgl, Graphics, ComCtrls, ExtCtrls, LCLType, GraphType, 10 10 Types, CustApp, LMessages, LCLIntf, Menus; … … 990 990 YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; 991 991 begin 992 Result := BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), ScaleToNative(Width), 993 ScaleToNative(Height), SrcDC, ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 992 {$IFDEF WINDOWS} 993 // LCLIntf.BitBlt is slower than direct Windows BitBlt 994 Result := Windows.BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 995 ScaleToNative(Width), ScaleToNative(Height), SrcDC, 996 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 997 {$ELSE} 998 Result := BitBlt(DestDC, ScaleToNative(X), ScaleToNative(Y), 999 ScaleToNative(Width), ScaleToNative(Height), SrcDC, 1000 ScaleToNative(XSrc), ScaleToNative(YSrc), Rop); 1001 {$ENDIF} 994 1002 end; 995 1003
Note:
See TracChangeset
for help on using the changeset viewer.