Exemple #1
0
        private void setZoomFactor(int newZoomFactor)
        {
            if (newZoomFactor < 1)
            {
                newZoomFactor = 1;
            }
            if (newZoomFactor > 250)
            {
                newZoomFactor = 250;
            }

            if (newZoomFactor != zoomFactor)
            {
                zoomFactor = newZoomFactor;

                zoomLabel.Text = LangMan.Get("zoom") + ": " + zoomFactor.ToString() + "%";

                setAutoZoom(false);

                int newWidth  = Convert.ToInt32(width * zoomFactor / 100);
                int newHeight = Convert.ToInt32(height * zoomFactor / 100);

                pictureBox.Size = new Size(newWidth, newHeight);

                MainHelper.UpdatePictureBoxLocation(picturePanel, pictureBox);
            }
        }
Exemple #2
0
 private void MiniViewForm_ResizeEnd(object sender, EventArgs e)
 {
     if (!autoZoom)
     {
         MainHelper.UpdatePictureBoxLocation(picturePanel, pictureBox);
     }
     zoomLabel.ForeColor = Width > 240 ? Color.White : Color.Black;
 }