private void buttonAddPhoto_Click(object sender, EventArgs e)
        {
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                photo = Image.FromFile(ofd.FileName);
                photo = ImageManip.ResizeImage(photo, new Size(400, 240));
            }

            photoByteArr           = ImageManip.ImageToByteArray(photo);
            pictureBoxSlider.Image = photo;

            photoSlider[photoNumber] = photoByteArr;
        }
        private void buttonNext_Click(object sender, EventArgs e)
        {
            if (photoNumber + 1 >= 5)
            {
                return;
            }
            photoNumber++;
            labelPhotoNumber.Text = $"{photoNumber + 1}/5";

            if (photoSlider[photoNumber] != null)
            {
                pictureBoxSlider.Image = ImageManip.ByteArrayToImage(photoSlider[photoNumber]);
            }
            else
            {
                pictureBoxSlider.Image = ImageManip.ResizeImage(Image.FromFile(noPhotoPath), new Size(400, 240));
            }
        }
Ejemplo n.º 3
0
        public FormRealEstateCreator()
        {
            InitializeComponent();
            realEstate = new RealEstate();

            numericUpDownRooms.DecimalPlaces = 0;
            numericUpDownRooms.Minimum       = 1;
            numericUpDownRooms.Maximum       = 99;
            numericUpDownFloor.DecimalPlaces = 0;
            numericUpDownFloor.Minimum       = 1;
            numericUpDownFloor.Maximum       = 99;

            Image noPhoto = Image.FromFile(noPhotoPath);

            noPhoto = ImageManip.ResizeImage(noPhoto, new Size(400, 240));
            pictureBoxSlider.Image = noPhoto;

            textBoxPrice.Text       = "0";
            comboBoxCity.DataSource = Enum.GetValues(typeof(Cities));

            ofd.Title       = "Select profile photo";
            ofd.Filter      = "JPG|*.jpg|PNG|*.png";
            ofd.Multiselect = false;
        }
 private void buttonDeletePhoto_Click(object sender, EventArgs e)
 {
     photoSlider[photoNumber] = null;
     pictureBoxSlider.Image   = ImageManip.ResizeImage(Image.FromFile(noPhotoPath), new Size(400, 240));
 }