private void buttonCalibrate_Click(object sender, EventArgs e) { Bitmap bmp = ScreenCapturer.CaptureHealthArea(); if (bmp != null) { bmp.Save("test.bmp", ImageFormat.Bmp); } }
private static void timerTask(Object source, ElapsedEventArgs e) { int tick = Environment.TickCount; Bitmap bitmap = ScreenCapturer.CaptureHealthArea(); if (bitmap != null) { int hp = NumberParser.ParseNumber(bitmap); } Console.WriteLine("Took " + (Environment.TickCount - tick) + "ms."); }