示例#1
0
        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();
                    }
                }
            }
        }
示例#2
0
 public void ToggleHideNames()
 {
     DpsDataGridView.ToggleHideNames();
     HpsDataGridView.ToggleHideNames();
 }