Changeset 331 for trunk/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- Mar 26, 2021, 3:24:15 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r323 r331 42 42 function LoadGraphicSet2(const Name: string): TGraphicSet; 43 43 procedure Dump(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer); 44 procedure BitmapReplaceColor(Dst: TBitmap; X, Y, Width, Height: Integer; OldColor, NewColor: TColor); 44 45 procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer); 45 46 overload; … … 567 568 end; 568 569 570 procedure BitmapReplaceColor(Dst: TBitmap; X, Y, Width, Height: Integer; OldColor, NewColor: TColor); 571 var 572 XX, YY: Integer; 573 PixelPtr: TPixelPointer; 574 begin 575 Dst.BeginUpdate; 576 PixelPtr := PixelPointer(Dst, ScaleToNative(X), ScaleToNative(Y)); 577 for YY := 0 to ScaleToNative(Height) - 1 do begin 578 for XX := 0 to ScaleToNative(Width) - 1 do begin 579 if PixelPtr.Pixel^.RGB = SwapRedBlue(OldColor) then begin 580 PixelPtr.Pixel^.RGB := SwapRedBlue(NewColor); 581 end; 582 PixelPtr.NextPixel; 583 end; 584 PixelPtr.NextLine; 585 end; 586 Dst.EndUpdate; 587 end; 588 569 589 procedure MakeBlue(Dst: TBitmap; X, Y, Width, Height: Integer); 570 590 var
Note:
See TracChangeset
for help on using the changeset viewer.