diff --git a/SpectrumView.pas b/SpectrumView.pas index 7e5ce5a..5667a20 100644 --- a/SpectrumView.pas +++ b/SpectrumView.pas @@ -19,7 +19,7 @@ interface uses Classes, SysUtils, Graphics, ExtCtrls, Controls, Math, - LCLIntf, LCLType, AppTheme, + AppTheme, AlertOverlay, SampleRateOverlay, VfoOverlay, WaterfallView, SMeterView, RulerView; @@ -98,6 +98,7 @@ type procedure DrawSpectrumGradient(const SpPts: array of TPoint; W, H: Integer); procedure DrawMarkerLine(C: TCanvas; W, H: Integer); procedure BlendBand(X1, X2, H: Integer; R, G, B, Alpha: Byte); + procedure CopyGridToSpectrum(W, H: Integer); procedure DrawADCOverloadOverlay(C: TCanvas; W, H: Integer); procedure CalcFilterBandX(VfoFreq: Double; W: Integer; out X1, X2, VfoX: Integer); @@ -282,6 +283,7 @@ begin FSpectrumBitmap := TBitmap.Create; FSpectrumBitmap.PixelFormat := pf32bit; FGridBitmap := TBitmap.Create; + FGridBitmap.PixelFormat := pf32bit; FGridBitmapW := 0; FGridBitmapH := 0; FFMGridLastCenter := -1.0; FFMGridLastStepHz := -1.0; FFMGridLastSpan := -1.0; FFMGridStepHz := 0.0; @@ -503,6 +505,27 @@ begin end; end; +procedure TSpectrumView.CopyGridToSpectrum(W, H: Integer); +var + Y: Integer; + Src, Dst: PByte; +begin + if (FSpectrumBitmap = nil) or (FGridBitmap = nil) then Exit; + if (W <= 0) or (H <= 0) then Exit; + FSpectrumBitmap.BeginUpdate(False); + try + for Y := 0 to H - 1 do + begin + Src := PByte(FGridBitmap.ScanLine[Y]); + Dst := PByte(FSpectrumBitmap.ScanLine[Y]); + if (Src <> nil) and (Dst <> nil) then + Move(Src^, Dst^, W * 4); + end; + finally + FSpectrumBitmap.EndUpdate(False); + end; +end; + procedure TSpectrumView.DrawADCOverloadOverlay(C: TCanvas; W, H: Integer); begin if not FADCOverloadVisible then Exit; @@ -761,7 +784,7 @@ begin end; end; end; - LCLIntf.BitBlt(C.Handle, 0, 0, W, H, FGridBitmap.Canvas.Handle, 0, 0, $CC0020); + CopyGridToSpectrum(W, H); // ── 2. Полоса фильтра ───────────────────────────────────────────────────── if FActiveVfo = 0 then CalcFilterBandX(FVfoA, W, X1, X2, VfoX)