Ejemplo n.º 1
0
        private void Btn_add_img_Click(object sender, EventArgs e)
        {
            if (filedlg_img.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            Cursor = Cursors.WaitCursor;

            int int_new_id = 0;

            if (dttable_img.Rows.Count > 0)
            {
                int_new_id = (from row in dttable_img
                              select row.vehicle_model_image).ToList().Min();
            }

            foreach (string str_filename in filedlg_img.FileNames)
            {
                int_new_id -= 1;

                dttable_img.Rows.Add(int_new_id,
                                     Class_image.Image_to_byte_array(Class_image.Resize_image(Image.FromFile(str_filename), 900)),
                                     "", Program.System_user.Name, DateTime.Now);

                grd_img.Rows[grd_img.Rows.Count - 1].Height = Program.GRD_IMAGE_ROW_HEIGHT;
            }

            Cursor = Cursors.Default;
        }
Ejemplo n.º 2
0
        private void Btn_change_image_Click(object sender, EventArgs e)
        {
            if (filedlg_img.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            picbox_image.Image = Class_image.Resize_image(Image.FromFile(filedlg_img.FileName), 400);
        }