Changeset 515 for trunk/Packages/CevoComponents
- Timestamp:
- Jan 3, 2024, 4:53:46 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/ScreenTools.pas
r514 r515 695 695 PixelSrc.NextLine; 696 696 end; 697 src.EndUpdate;697 Src.EndUpdate; 698 698 Dst.EndUpdate; 699 699 end; … … 709 709 SrcPixel: TPixelPointer; 710 710 DstPixel: TPixelPointer; 711 begin 711 DstWidth, DstHeight: Integer; 712 SrcWidth, SrcHeight: Integer; 713 begin 714 if xDst < 0 then begin 715 Width := Width + xDst; 716 xSrc := xSrc - xDst; 717 xDst := 0; 718 end; 719 if yDst < 0 then begin 720 Height := Height + yDst; 721 ySrc := ySrc - yDst; 722 yDst := 0; 723 end; 724 if xDst + Width > Dst.Width then 725 Width := Dst.Width - xDst; 726 if yDst + Height > Dst.Height then 727 Height := Dst.Height - yDst; 728 if (Width < 0) or (Height < 0) then 729 Exit; 730 DstWidth := ScaleToNativeDist(xDst, Width); 731 DstHeight := ScaleToNativeDist(yDst, Height); 732 SrcWidth := ScaleToNativeDist(xSrc, Width); 733 SrcHeight := ScaleToNativeDist(ySrc, Height); 712 734 xDst := ScaleToNative(xDst); 713 735 yDst := ScaleToNative(yDst); 714 736 xSrc := ScaleToNative(xSrc); 715 737 ySrc := ScaleToNative(ySrc); 716 Width := ScaleToNative(Width);717 Height := ScaleToNative(Height);718 if xDst < 0 then begin719 Width := Width + xDst;720 xSrc := xSrc - xDst;721 xDst := 0;722 end;723 if yDst < 0 then begin724 Height := Height + yDst;725 ySrc := ySrc - yDst;726 yDst := 0;727 end;728 if xDst + Width > ScaleToNative(Dst.Width) then729 Width := ScaleToNative(Dst.Width) - xDst;730 if yDst + Height > ScaleToNative(Dst.Height) then731 Height := ScaleToNative(Dst.Height) - yDst;732 if (Width < 0) or (Height < 0) then733 Exit;734 738 735 739 Src.BeginUpdate; … … 737 741 SrcPixel := TPixelPointer.Create(Src, xSrc, ySrc); 738 742 DstPixel := TPixelPointer.Create(Dst, xDst, yDst); 739 for iy := 0 to Height - 1 do begin740 for ix := 0 to Width - 1 do begin743 for iy := 0 to DstHeight - 1 do begin 744 for ix := 0 to DstWidth - 1 do begin 741 745 trans := SrcPixel.PixelB * 2; // green channel = transparency 742 746 amp1 := SrcPixel.PixelG * 2; … … 756 760 end; 757 761 758 SrcPixel.NextPixel;762 if ix < SrcWidth - 1 then SrcPixel.NextPixel; 759 763 DstPixel.NextPixel; 760 764 end; 761 SrcPixel.NextLine; 765 if iy < SrcHeight - 1 then SrcPixel.NextLine 766 else SrcPixel.SetX(0); 762 767 DstPixel.NextLine; 763 768 end;
Note:
See TracChangeset
for help on using the changeset viewer.