示例#1
0
        private void LoadImage()
        {
            Sizes sizes = new Sizes();
            int offset = sizes.OFFSET * 3;
            //Creates object of file dialog and sets filter to just show pcitures
            OpenFileDialog openFileDialog = new OpenFileDialog();
            String File_Name;
            openFileDialog.Filter = "Bitmap (*.bmp)|*.bmp|JPEG (*.jpeg)|*.jpeg;*.jpg|PNG (*.png)|*.png";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                File_Name = openFileDialog.FileName;

                //Saves bitmap of selected file and adjusts the size of picture fram and the form
                Bitmap bitmap = new Bitmap(File_Name);
                pic_MainImage.Height = bitmap.Height;
                pic_MainImage.Width = bitmap.Width;

                this.Height = bitmap.Height + offset;
                //To account for both images
                this.Width = (bitmap.Width * 2) + offset;

                pic_MainImage.ImageLocation = File_Name;

                //Moves other picturebox out of the way
                SetModifyPictureBox();
                //pic_ModifyImage.Height = bitmap.Height;
                //pic_ModifyImage.Width = bitmap.Width;
                //pic_ModifyImage.ImageLocation = File_Name;
            }
        }
示例#2
0
        public Form1()
        {
            //Set up logger
            //xmlConfig();
               // XmlConfigurator.Configure();
            DOMConfigurator.Configure();
            InitializeComponent();
            Sizes sizes = new Sizes();
            Logger.Info("Logger has started!");

            //Slightly offsets the image from the edges
            pic_MainImage.Top = sizes.OFFSET;
            pic_MainImage.Left = sizes.OFFSET;
        }
示例#3
0
        private void CheckWidthAndHeightForBothImages()
        {
            //offset * 4 image * 2
            Sizes sizes = new Sizes();
            //Covers the offset left around edges and the one added between pcitures.
            int offset = sizes.OFFSET * 4;
            //Forms width and height
            int width = this.Width;
            int height = this.Height;

            //Finds the screen resolution
            int MaxHeight = sizes.SCREEN_HEIGHT;
            int MaxWidth = sizes.SCREEN_WIDTH;

            if(((width + offset) > MaxWidth) ||((height + offset) > MaxHeight)){

            }
        }
示例#4
0
 /// <summary>
 /// Creates the new image box the same size as the original image and puts a space between the two images
 /// </summary>
 private void SetModifyPictureBox()
 {
     Sizes sizes = new Sizes();
     pic_ModifyImage.Left = pic_MainImage.Right + sizes.OFFSET;
     pic_ModifyImage.Top = sizes.OFFSET;
 }