private void CaptureHotKey_KeyPressed(object sender, EventArgs e) { bool originalDpsNameHidden = ActPlugin.Setting.OverlaySetting.DpsTable.IsNameHidden; bool originalHpsNameHidden = ActPlugin.Setting.OverlaySetting.HpsTable.IsNameHidden; if (ActPlugin.Setting.OverlaySetting.HideNamesWhenCapturing) { if (!originalDpsNameHidden) { DpsDataGridView.ToggleHideNames(); } if (!originalHpsNameHidden) { HpsDataGridView.ToggleHideNames(); } } try { Bitmap bitmap = Utility.PrintWindow(Handle); bitmap.Save( Path.Combine( ActPlugin.Setting.OverlaySetting.CaptureSavePath, DateTime.UtcNow.ToString("yyyyMMdd_HHmmss_") + currentEncounterData.Title + ".png"), ImageFormat.Png); if (ActPlugin.Setting.OverlaySetting.PutCaptureInClipboard) { Clipboard.SetImage(bitmap); } ActPlugin.Overlay.Visible = false; Thread.Sleep(100); ActPlugin.Overlay.Visible = true; } finally { if (ActPlugin.Setting.OverlaySetting.HideNamesWhenCapturing) { if (!originalDpsNameHidden) { DpsDataGridView.ToggleHideNames(); } if (!originalHpsNameHidden) { HpsDataGridView.ToggleHideNames(); } } } }
public void ToggleHideNames() { DpsDataGridView.ToggleHideNames(); HpsDataGridView.ToggleHideNames(); }