Changeset 211 for trunk/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- May 9, 2020, 9:04:03 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r208 r211 35 35 procedure Sprite(dst: TBitmap; HGr, xDst, yDst, Width, Height, xGr, yGr: integer); 36 36 overload; 37 procedure MakeBlue(dst: TBitmap; x, y, Width, Height: Integer); 37 procedure MakeBlue(Dst: TBitmap; X, Y, Width, Height: Integer); 38 procedure MakeRed(Dst: TBitmap; X, Y, Width, Height: Integer); 38 39 procedure ImageOp_B(dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, Width, Height: Integer); 39 40 procedure ImageOp_BCC(dst, Src: TBitmap; … … 538 539 end; 539 540 540 procedure MakeBlue( dst: TBitmap; x, y, Width, Height: Integer);541 var 542 XX, YY: integer;541 procedure MakeBlue(Dst: TBitmap; X, Y, Width, Height: Integer); 542 var 543 XX, YY: Integer; 543 544 PixelPtr: TPixelPointer; 544 545 begin … … 550 551 PixelPtr.Pixel^.G := PixelPtr.Pixel^.G div 2; 551 552 PixelPtr.Pixel^.R := PixelPtr.Pixel^.R div 2; 553 PixelPtr.NextPixel; 554 end; 555 PixelPtr.NextLine; 556 end; 557 Dst.EndUpdate; 558 end; 559 560 procedure MakeRed(Dst: TBitmap; X, Y, Width, Height: Integer); 561 var 562 XX, YY: Integer; 563 Gray: Integer; 564 PixelPtr: TPixelPointer; 565 begin 566 Dst.BeginUpdate; 567 PixelPtr := PixelPointer(Dst, X, Y); 568 for YY := 0 to Height - 1 do begin 569 for XX := 0 to Width - 1 do begin 570 Gray := (Integer(PixelPtr.Pixel^.B) + Integer(PixelPtr.Pixel^.G) + 571 Integer(PixelPtr.Pixel^.R)) * 85 shr 8; 572 PixelPtr.Pixel^.B := 0; 573 PixelPtr.Pixel^.G := 0; 574 PixelPtr.Pixel^.R := Gray; // 255-(255-gray) div 2; 552 575 PixelPtr.NextPixel; 553 576 end;
Note:
See TracChangeset
for help on using the changeset viewer.