示例#1
0
 private void SubReports_Load(object sender, EventArgs e)
 {
     data        = new data_class();
     calculation = new calculation_class();
     dt          = new DataTable();
     data.open_connection();
     ds = data.select_custom_test();
     select_box.ValueMember   = "test_id";
     select_box.DisplayMember = "test_name";
     select_box.DataSource    = ds;
 }
示例#2
0
        private void Sub_Sheet_Designer_Load(object sender, EventArgs e)
        {
            option           = (int)option_type.NONE;
            bubbleWidth      = 30;
            bubbleHeight     = 30;
            X_bubbleSpace    = x_space_bar.Value;
            Y_bubbleSpace    = y_space_bar.Value;
            radius_bar.Value = bubbleWidth / 2;

            calculate = new calculation_class();
            data      = new data_class();
            data.open_connection();
            status_lbl.Text = "Ready";
        }
示例#3
0
        private void start_processing()
        {
            int count = files.Length;
            int i     = 1;

            foreach (string file_load in files)
            {
                if (Path.GetExtension(file_load) == ".jpeg" || Path.GetExtension(file_load) == ".jpg" || Path.GetExtension(file_load) == ".JPG")
                {
                    SetText("Processing file " + file_load + "\n------------------------------------------\n");
                    if (status_lbl2.InvokeRequired)
                    {
                        status_lbl2.Invoke(new Action(() =>
                        {
                            status_lbl2.Text = "Processing File : " + i + " of " + count;
                        }));
                    }
                    else
                    {
                        status_lbl2.Text = "Processing File : " + i + " of " + count;
                    }
                    SetBitmap(file_load);

                    img = new Bitmap(file_load);



                    calculation = new calculation_class();
                    double percent = 0.0;
                    if (img.Width >= width)
                    {
                        percent = calculation.percentageDecrease(img.Width, width);
                    }
                    else
                    {
                        percent = calculation.percentageIncrease(img.Width, width);
                    }

                    Size sz = calculation.increaseScale(img.Width, img.Height, percent);
                    img = resizeImage((Image)img, sz.Width, sz.Height);
                    img = new Bitmap(img, new Size(width, height));

                    img = greyscale(img);


                    if (!fix_orientiation())
                    {
                        MessageBox.Show("Not Properly Aligned. Image Path : " + file_load);
                        continue;
                    }

                    file = file_load;

                    //img.Save(file_load+"PROCESSED"); // FOR DEBUGGING
                    findname();
                    findroll();
                    findresult();
                    name      = name.Trim();
                    questions = questions.Trim(new char[] { ',', ' ' });
                    if (roll == "")
                    {
                        roll = "00";
                    }
                    dt.Rows.Add(name,
                                roll, total, questions, options.Rows.Count * 5
                                );

                    name      = "";
                    roll      = "";
                    total     = 0;
                    questions = "";

                    img.Dispose();
                    i++;
                }
            }
            if (result_gridview.InvokeRequired)
            {
                result_gridview.Invoke(new Action(() =>
                {
                    result_gridview.DataSource = dt;
                    status_lbl2.Visible        = false;
                    result_gridview.Visible    = true;
                    result_gridview.Refresh();
                }));
            }
            else
            {
                result_gridview.DataSource = dt;
                status_lbl2.Visible        = false;
                result_gridview.Visible    = true;
                result_gridview.Refresh();
            }
            if (save_result_txt.InvokeRequired)
            {
                save_result_txt.Invoke(new Action(() =>
                {
                    save_result_txt.Visible = true;
                    save_result_btn.Visible = true;
                    csv_btn.Visible         = true;
                    reset_btn.Visible       = true;
                    status_lbl.Text         = "Processing Completed";
                }));
            }
            else
            {
                save_result_txt.Visible = true;
                save_result_btn.Visible = true;
                csv_btn.Visible         = true;
                reset_btn.Visible       = true;
                status_lbl.Text         = "Processing Completed";
            }
            //result_gridview.DataSource = dt;
        }