コード例 #1
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            pbPreview = new MyPictureBox();
            SuspendLayout();

            BackColor       = SystemColors.Window;
            Bounds          = CaptureHelpers.GetActiveScreenBounds();
            DoubleBuffered  = true;
            FormBorderStyle = FormBorderStyle.None;
            Text            = "ShareX - Image viewer";
            TopMost         = true;
            WindowState     = FormWindowState.Normal;
            StartPosition   = FormStartPosition.Manual;

            pbPreview.Cursor = Cursors.Hand;
            pbPreview.Dock   = System.Windows.Forms.DockStyle.Fill;
            pbPreview.DrawCheckeredBackground = true;
            pbPreview.FullscreenOnClick       = false;
            pbPreview.Location           = new System.Drawing.Point(0, 0);
            pbPreview.Name               = "pbPreview";
            pbPreview.ShowImageSizeLabel = true;
            pbPreview.Size               = new System.Drawing.Size(96, 100);
            pbPreview.TabIndex           = 0;
            pbPreview.LoadImage(screenshot);
            Controls.Add(pbPreview);

            Shown               += new System.EventHandler(ShowScreenshot_Shown);
            Deactivate          += new System.EventHandler(ShowScreenshot_Deactivate);
            pbPreview.MouseDown += pbPreview_MouseDown;
            pbPreview.KeyDown   += pbPreview_KeyDown;

            ResumeLayout(false);
        }
コード例 #2
0
ファイル: ImageViewer.cs プロジェクト: hobosoft/ShareX
        private void InitializeComponent()
        {
            pbPreview = new MyPictureBox();
            lblStatus = new Label();
            lblLeft   = new Label();
            lblRight  = new Label();
            SuspendLayout();

            BackColor       = SystemColors.Window;
            Bounds          = CaptureHelpers.GetActiveScreenBounds();
            DoubleBuffered  = true;
            FormBorderStyle = FormBorderStyle.None;
            // TODO: Translate
            Text          = "ShareX - Image viewer";
            TopMost       = true;
            WindowState   = FormWindowState.Normal;
            StartPosition = FormStartPosition.Manual;

            lblStatus.AutoSize  = true;
            lblStatus.Font      = new Font("Arial", 13f);
            lblStatus.Padding   = new Padding(5);
            lblStatus.TextAlign = ContentAlignment.MiddleCenter;
            Controls.Add(lblStatus);

            lblLeft.Cursor     = Cursors.Hand;
            lblLeft.Font       = new Font("Arial", 50f, FontStyle.Bold);
            lblLeft.Location   = new Point(0, 0);
            lblLeft.Text       = "‹";
            lblLeft.TextAlign  = ContentAlignment.MiddleCenter;
            lblLeft.Size       = new Size(NavigationButtonWidth, Bounds.Height);
            lblLeft.MouseDown += lblLeft_MouseDown;
            Controls.Add(lblLeft);

            lblRight.Cursor     = Cursors.Hand;
            lblRight.Font       = new Font("Arial", 50f, FontStyle.Bold);
            lblRight.Location   = new Point(Bounds.Width - NavigationButtonWidth, 0);
            lblRight.Text       = "›";
            lblRight.TextAlign  = ContentAlignment.MiddleCenter;
            lblRight.Size       = new Size(NavigationButtonWidth, Bounds.Height);
            lblRight.MouseDown += lblRight_MouseDown;
            Controls.Add(lblRight);

            pbPreview.Dock = DockStyle.Fill;
            pbPreview.DrawCheckeredBackground = true;
            pbPreview.Location = new Point(0, 0);
            pbPreview.Size     = new Size(100, 100);
            pbPreview.TabIndex = 0;
            Controls.Add(pbPreview);

            Shown                    += ImageViewer_Shown;
            Deactivate               += ImageViewer_Deactivate;
            pbPreview.MouseClick     += pbPreview_MouseClick;
            pbPreview.MouseMove      += pbPreview_MouseMove;
            pbPreview.MouseWheel     += pbPreview_MouseWheel;
            pbPreview.KeyDown        += pbPreview_KeyDown;
            pbPreview.PreviewKeyDown += pbPreview_PreviewKeyDown;
            lblStatus.MouseEnter     += lblStatus_MouseEnter;

            ResumeLayout(false);
        }
コード例 #3
0
ファイル: ImageViewer.cs プロジェクト: k3d3/ShareX
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.pbPreview = new MyPictureBox();
            this.SuspendLayout();

            this.pbPreview.BackColor = System.Drawing.Color.White;
            this.pbPreview.Cursor = Cursors.Hand;
            this.pbPreview.Dock = System.Windows.Forms.DockStyle.Fill;
            this.pbPreview.DrawCheckeredBackground = true;
            this.pbPreview.FullscreenOnClick = false;
            this.pbPreview.Location = new System.Drawing.Point(0, 0);
            this.pbPreview.Name = "pbPreview";
            this.pbPreview.Size = new System.Drawing.Size(96, 100);
            this.pbPreview.TabIndex = 0;
            this.pbPreview.LoadImage(screenshot);

            this.BackColor = Color.White;
            this.Bounds = CaptureHelpers.GetScreenBounds();
            this.DoubleBuffered = true;
            this.FormBorderStyle = FormBorderStyle.None;
            this.Text = "ShareX - Image viewer";
            this.TopMost = true;
            this.WindowState = FormWindowState.Maximized;
            this.Controls.Add(this.pbPreview);

            this.Shown += new System.EventHandler(this.ShowScreenshot_Shown);
            this.Deactivate += new System.EventHandler(this.ShowScreenshot_Deactivate);
            pbPreview.MouseDown += pbPreview_MouseDown;
            pbPreview.KeyDown += pbPreview_KeyDown;

            this.ResumeLayout(false);
        }