public static void UpdateHeroHP(CurrentGameState state)
{
TickNow();
if (ShouldBringToFront) ControlInput.BringHeroesToFront();
var src = GrabScreenGDI(new Rectangle(160, 695, 155, 1));
var sourceImage = ChangePixelFormat(src, PixelFormat.Format24bppRgb);
Tools.ColorFilter.Red = new IntRange(50, 255);
Tools.ColorFilter.Green = new IntRange(50, 255);
Tools.ColorFilter.Blue = new IntRange(0, 50);
Tools.ColorFilter.ApplyInPlace(sourceImage);
var grayScale = Grayscale.CommonAlgorithms.BT709.Apply(sourceImage);
Tools.Thresholder.ThresholdValue = 1;
Tools.Thresholder.ApplyInPlace(grayScale);
state.Me.HeroHP = Tools.FindHorizontalLineLength(grayScale)/145f*100f;
src.Dispose();
MainWindow.DebugReaderStats("HeroHP:" + TickNow());
}