Exemple #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.Visible = false;
            this.LoadOption();
            this.InitData();

            var tDpi = Math.Max(1, DPIUtils.GetPrimaryDpi());

            this.Width  = (int)Math.Round(300 * tDpi);
            this.Height = (int)Math.Round(100 * tDpi);

            this.OptionApply();
            this.SaveOption();
            if (this.optSetuna.Setuna.ShowSplashWindow)
            {
                this.frmSplash = new SplashForm();
                base.AddOwnedForm(this.frmSplash);
                this.frmSplash.Show(this);
                this.frmSplash.SplashTimer.Start();
            }
            this.timPool.Start();
            cap_form     = new CaptureForm(this.optSetuna.Setuna);
            this.IsStart = true;

            mLayerInfo = new LayerInfo(this);

            this.UpdateTopMostTimer();
        }
Exemple #2
0
        public void InitData()
        {
            CacheManager.Init(info =>
            {
                this.scrapBook.AddScrap(info, true);
            });

            DPIUtils.Init();
        }
Exemple #3
0
        private void ThreadTask()
        {
            var tScreen     = targetScreen;
            var tScreenSize = screenNewSize;
            var tDpi        = DPIUtils.GetDpiByScreen(tScreen);

            var tBitmap = new Bitmap(tScreenSize.Width, tScreenSize.Height, PixelFormat.Format24bppRgb);

            tBitmap.SetResolution(tDpi * 96, tDpi * 96);
            imgSnap = tBitmap;

            if (CopyFromScreen(imgSnap, new Point(this.targetScreen.Bounds.X, this.targetScreen.Bounds.Y)))
            {
                base.Invoke(new ShowFormDelegate(this.ShowForm));
            }
            else
            {
                base.Invoke(new ShowFormDelegate(this.CancelForm));
            }
        }