Changeset 192 for trunk/Packages/CevoComponents/ScreenTools.pas
- Timestamp:
- May 7, 2020, 12:30:04 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r190 r192 7 7 Windows, 8 8 {$ENDIF} 9 StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, 9 StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math, 10 10 Forms, Menus, GraphType; 11 11 … … 35 35 procedure Sprite(dst: TBitmap; HGr, xDst, yDst, Width, Height, xGr, yGr: integer); 36 36 overload; 37 procedure MakeBlue(dst: TBitmap; x, y, w, h: integer);37 procedure MakeBlue(dst: TBitmap; x, y, Width, Height: Integer); 38 38 procedure ImageOp_B(dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, w, h: integer); 39 39 procedure ImageOp_BCC(dst, Src: TBitmap; … … 41 41 procedure ImageOp_CCC(bmp: TBitmap; x, y, w, h, Color0, Color1, Color2: integer); 42 42 function BitBltCanvas(DestCanvas: TCanvas; X, Y, Width, Height: Integer; 43 SrcCanvas: TCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; 43 SrcCanvas: TCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; overload; 44 function BitBltCanvas(Dest: TCanvas; DestRect: TRect; 45 Src: TCanvas; SrcPos: TPoint; Rop: DWORD = SRCCOPY): Boolean; overload; 46 function BitBltBitmap(Dest: TBitmap; X, Y, Width, Height: Integer; 47 Src: TBitmap; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; overload; 48 function BitBltBitmap(Dest: TBitmap; DestRect: TRect; 49 Src: TBitmap; SrcPos: TPoint; Rop: DWORD = SRCCOPY): Boolean; overload; 44 50 procedure SLine(ca: TCanvas; x0, x1, y: integer; cl: TColor); 45 51 procedure DLine(ca: TCanvas; x0, x1, y: integer; cl0, cl1: TColor); … … 52 58 procedure InitOrnament; 53 59 procedure InitCityMark(const T: TTexture); 54 procedure Fill(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: integer); 60 procedure Fill(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: integer); overload; 61 procedure Fill(Canvas: TCanvas; Rect: TRect; Offset: TPoint); overload; 55 62 procedure FillLarge(ca: TCanvas; x0, y0, x1, y1, xm: integer); 56 63 procedure FillSeamless(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: integer; … … 82 89 procedure LoadPhrases; 83 90 procedure Texturize(Dest, Texture: TBitmap; TransparentColor: Integer); 91 procedure DarkenImage(Bitmap: TBitmap; Change: Integer); 84 92 85 93 const … … 527 535 end; 528 536 529 procedure MakeBlue(dst: TBitmap; x, y, w, h: integer);537 procedure MakeBlue(dst: TBitmap; x, y, Width, Height: Integer); 530 538 var 531 539 XX, YY: integer; … … 534 542 Dst.BeginUpdate; 535 543 PixelPtr.Init(Dst, X, Y); 536 for yy := 0 to h- 1 do begin537 for xx := 0 to w- 1 do begin544 for yy := 0 to Height - 1 do begin 545 for xx := 0 to Width - 1 do begin 538 546 PixelPtr.Pixel^.B := PixelPtr.Pixel^.B div 2; 539 547 PixelPtr.Pixel^.G := PixelPtr.Pixel^.G div 2; … … 730 738 Result := True; 731 739 end else Result := BitBlt(DestCanvas.Handle, X, Y, Width, Height, SrcCanvas.Handle, XSrc, YSrc, Rop); 740 end; 741 742 function BitBltCanvas(Dest: TCanvas; DestRect: TRect; Src: TCanvas; 743 SrcPos: TPoint; Rop: DWORD): Boolean; 744 begin 745 Result := BitBltCanvas(Dest, DestRect.Left, DestRect.Top, DestRect.Width, DestRect.Height, 746 Src, SrcPos.X, SrcPos.Y, Rop); 747 end; 748 749 function BitBltBitmap(Dest: TBitmap; X, Y, Width, Height: Integer; 750 Src: TBitmap; XSrc, YSrc: Integer; Rop: DWORD): Boolean; 751 begin 752 Result := BitBltCanvas(Dest.Canvas, X, Y, Width, Height, Src.Canvas, XSrc, YSrc, Rop); 753 end; 754 755 function BitBltBitmap(Dest: TBitmap; DestRect: TRect; Src: TBitmap; 756 SrcPos: TPoint; Rop: DWORD): Boolean; 757 begin 758 Result := BitBltCanvas(Dest.Canvas, DestRect, Src.Canvas, SrcPos, Rop); 732 759 end; 733 760 … … 901 928 BitBltCanvas(ca, Left, Top, Width, Height, MainTexture.Image.Canvas, 902 929 Left + xOffset, Top + yOffset); 930 end; 931 932 procedure Fill(Canvas: TCanvas; Rect: TRect; Offset: TPoint); 933 begin 934 Fill(Canvas, Rect.Left, Rect.Top, Rect.Width, Rect.Height, Offset.X, Offset.Y); 903 935 end; 904 936 … … 1426 1458 end; 1427 1459 1460 procedure DarkenImage(Bitmap: TBitmap; Change: Integer); 1461 var 1462 x, y: integer; 1463 PicturePixel: TPixelPointer; 1464 begin 1465 Bitmap.BeginUpdate; 1466 PicturePixel.Init(Bitmap); 1467 for y := 0 to Bitmap.Height - 1 do begin 1468 for x := 0 to Bitmap.Width - 1 do begin 1469 PicturePixel.Pixel^.B := Max(PicturePixel.Pixel^.B - Change, 0); 1470 PicturePixel.Pixel^.G := Max(PicturePixel.Pixel^.G - Change, 0); 1471 PicturePixel.Pixel^.R := Max(PicturePixel.Pixel^.R - Change, 0); 1472 PicturePixel.NextPixel; 1473 end; 1474 PicturePixel.NextLine; 1475 end; 1476 Bitmap.EndUpdate; 1477 end; 1478 1428 1479 procedure LoadFonts; 1429 1480 var
Note:
See TracChangeset
for help on using the changeset viewer.