Newer
Older
TIASShot / TIASshot / PreviewMonitor.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TIASshot {
    public partial class PreviewMonitor : Form {
        public bool IsShown { get; private set; } = false;

        public PreviewMonitor() {
            InitializeComponent();
            Visible = false;

        }

        private void PreviewMonitor_Load(object sender, EventArgs e) {
            // プレビューウィンドウの位置とサイズを設定
            foreach (var scr in Screen.AllScreens) {
                if (scr.Primary) continue; // プライマリスクリーンは除外
                if (scr.Bounds.Width <= Config.GetInt("Shot/PreviewMonitorWidth")) {
                    Location = new Point(scr.Bounds.X, scr.Bounds.Y);
                    this.Size = scr.Bounds.Size;
                    IsShown = true;
                    Visible = true;
                }
            }
        }

        public void ShowFrame(Bitmap bmp) {
            if (!IsShown) return;
            picPreview.Image = bmp;
        }

        private void label4_Click(object sender, EventArgs e) {

        }
    }
}