예제 #1
0
 public ViewProperties(AxPXV_Control axPXV_Control1)
 {
     InitializeComponent();
     checkBox1.Checked = true;
     workspace_ob = new Workspace();
     this.axPXV_Control1 = axPXV_Control1;
 }
예제 #2
0
        public static string get_string_for_save(Workspace workspace)
        {
            int height = workspace.field_ex.heigth;
            int width = workspace.field_ex.width;
            int Rect_size = workspace.field_ex.size_rect;
            List<Workspace.key> keys = workspace.keys;
            List<List<System.Drawing.Color>> field_colors = workspace.field_ex.clr_fild;

            string output = "";
            output += (height + "/" + width + "/" + Rect_size + "/");

            output += keys.Count;
            output += "/";

            foreach(var key in keys)
            {
                string hex_color = HexConverter(key.clr);
                output += (hex_color + "!");
            }

            output += "/";
            foreach(var i_color in field_colors)
            {
                foreach(var j_color in i_color)
                {
                    string hex_color = "";
                    if (j_color.Name == System.Drawing.Color.Transparent.Name)
                        hex_color = "T";
                    else
                        hex_color = HexConverter(j_color);
                    output += (hex_color + "!");
                }
            }
            return output;
        }
예제 #3
0
 private ViewProperties()
 {
     InitializeComponent();
     checkBox1.Checked = true;
     workspace_ob = new Workspace();
     
 }
예제 #4
0
        public static void interpretate_string_for_open(string input, Workspace workspace)
        {
            string[] allParams = input.Split('/');

            workspace.field_ex.heigth = int.Parse(allParams[0]);
            workspace.field_ex.width = int.Parse(allParams[1]);
            workspace.field_ex.size_rect = int.Parse(allParams[2]);
            int keys_Count = int.Parse(allParams[3]);
            string[] all_keys = allParams[4].Split('!');
            workspace.keys.Clear();

            for(int i = 0; i < keys_Count; i++)
            {
                System.Drawing.Color curveColor = System.Drawing.ColorTranslator.FromHtml(all_keys[i]);
                workspace.keys.Add(new Workspace.key("", curveColor));
            }
            string[] all_colors = allParams[5].Split('!');

            for(int i = 0, k = 0; i < workspace.field_ex.width; i++, k++)
            {
                for(int j = 0; j < workspace.field_ex.heigth; j++, k++)
                {
                    if (all_colors[k] == "T") continue;
                    System.Drawing.Color curveColor = System.Drawing.ColorTranslator.FromHtml(all_colors[k]);
                    workspace.field_ex.clr_fild[i][j] = curveColor;
                }
            }
        }
예제 #5
0
 public static void SaveImage(AxPXV_Control axPXV_Control1, Workspace workspace_ob, string imageDest, IXC_ImageFileFormatIDs format)
 {
     IXC_PageFormat nFormat = IXC_PageFormat.PageFormat_8Indexed;
     IIXC_Inst inst = (IIXC_Inst)axPXV_Control1.Inst.GetExtension("IXC");
     IIXC_Page page_ixc = inst.Page_CreateEmpty((uint)workspace_ob.field_ex.width, (uint)workspace_ob.field_ex.heigth, nFormat, 324345);
     page_ixc.PaletteSize = (uint)workspace_ob.keys.Count;
     for (int i = 0; i < workspace_ob.field_ex.width; i++)
     {
         for (int j = 0; j < workspace_ob.field_ex.heigth; j++)
         {
             Color clr = workspace_ob.field_ex.clr_fild[i][j];
             uint clgr = (uint)((byte)(clr.R) | ((UInt16)((byte)(clr.G)) << 8)) | (((UInt32)(byte)(clr.B)) << 16);
             page_ixc.SetPixel(i, j, (uint)clgr, (uint)IXC_ColorFlags.Color_AddColor);
         }
     }
     page_ixc.ConvertToFormat(nFormat);
     IIXC_Image img = inst.CreateEmptyImage();
     img.InsertPage(page_ixc);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_FILTER, 0);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_FORMAT, (uint)format);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_ITYPE, 16);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_COMP_LEVEL, 2);
     page_ixc.set_FmtInt((uint)IXC_FormatParametersIDS.FP_ID_COMP_TYPE, 0);
     img.Save(imageDest, IXC_CreationDisposition.CreationDisposition_Overwrite);
 }
예제 #6
0
 public ViewProperties(AxPXV_Control axPXV_Control1, bool q)
 {
     InitializeComponent();
     checkBox1.Checked = true;
     workspace_ob = new Workspace();
     this.axPXV_Control1 = axPXV_Control1;
     tabControl1.SelectedIndex = 1;
 }
예제 #7
0
 public ViewProperties()
 {
     InitializeComponent();
     workspace_ob = new Workspace();
 }
예제 #8
0
 private void optionsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     TabOptions op = new TabOptions();
     if (workspace_ob.keys.Count < 2)
     {
         textBox_info.Text = "Please, add more keys.";
         return;
     }
     op.workspace_ob = this.workspace_ob;
     op.workspace_ob_last = this.workspace_ob;
     if (op.ShowDialog() == DialogResult.OK)
     {
         this.workspace_ob = op.workspace_ob;
         GenerateNumbers();
     }
     else return;
 }
예제 #9
0
        private void propetiesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ViewProperties vp = new ViewProperties(axPXV_Control1);
            vp.workspace_ob = workspace_ob;
            vp.ShowDialog();
            workspace_ob = vp.workspace_ob;

            if (workspace_ob.field_ex.width > 20)
            {
                hScrollBar1.Visible = true;
                hScrollBar1.Minimum = 1;
                hScrollBar1.Maximum = (workspace_ob.field_ex.width - 18) * 5;
            }
            else
                hScrollBar1.Visible = false;

            if (workspace_ob.field_ex.heigth > 20)
            {
                vScrollBar1.Visible = true;
                vScrollBar1.Minimum = 1;
                vScrollBar1.Maximum = (workspace_ob.field_ex.heigth - 18) * 5;
            }
            else
                vScrollBar1.Visible = false;

            if (workspace_ob.field_ex.width <= 20 && workspace_ob.field_ex.heigth > workspace_ob.field_ex.width)
            {
                vScrollBar1.Visible = true;
                vScrollBar1.Minimum = 1;
                vScrollBar1.Maximum = (workspace_ob.field_ex.heigth - workspace_ob.field_ex.width + 2) * 5;
            }
            Refresh();
        }
예제 #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            ViewProperties vp = new ViewProperties(axPXV_Control1, true);
            vp.workspace_ob = workspace_ob;
            
            vp.ShowDialog();
            workspace_ob = vp.workspace_ob;

            if (workspace_ob.field_ex.width > 20)
            {
                hScrollBar1.Visible = true;
                hScrollBar1.Minimum = 1;
                hScrollBar1.Maximum = (workspace_ob.field_ex.width - 18) * 5;
            }
            else
                hScrollBar1.Visible = false;

            if (workspace_ob.field_ex.heigth > 20)
            {
                vScrollBar1.Visible = true;
                vScrollBar1.Minimum = 1;
                vScrollBar1.Maximum = (workspace_ob.field_ex.heigth - 18) * 5;
            }
            else
                vScrollBar1.Visible = false;

            if (workspace_ob.field_ex.width <= 20 && workspace_ob.field_ex.heigth > workspace_ob.field_ex.width)
            {
                vScrollBar1.Visible = true;
                vScrollBar1.Minimum = 1;
                vScrollBar1.Maximum = (workspace_ob.field_ex.heigth - workspace_ob.field_ex.width + 2) * 5;
            }
            if (workspace_ob.activationKey != "")
                groupBox_demo.Visible = false;
            Refresh();
        }
예제 #11
0
 private void optionsToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     TabOptions op = new TabOptions();
     if (workspace_ob.op.game_mod == Workspace.options.g_mod.BASIC_EVEN_ODD && workspace_ob.keys.Count < 2)
     {
         textBox_info.Text = "Please, add more keys.";
         return;
     }
     op.workspace_ob = this.workspace_ob;
     op.workspace_ob_last = this.workspace_ob;
     if (op.ShowDialog() == DialogResult.OK)
     {
         this.workspace_ob = op.workspace_ob;
         foreach (Workspace.key a in workspace_ob.keys)
         {
             a.str = "";
         }
         GenereteNumbers.workspace = workspace_ob;
         GenereteNumbers.Generate_Number();
         update_dataGridView1();
         Refresh();
     }
     else return;
 }
예제 #12
0
        public static string saves_string_for_save_conf(Workspace workspace)
        {
            string result = "";
            result = workspace.field_ex.width.ToString() + " " + workspace.field_ex.heigth.ToString() + "\n";
            result += workspace.op.game_mod.ToString() + "\n";
            result += workspace.op.addition_act.ToString() + "," + workspace.op.subtraction_act.ToString() + "," + workspace.op.division_act.ToString() + "," + workspace.op.multiplication_act.ToString() + "\n";
            result += workspace.op.active_fractions_mode.ToString() + "\n";
            result += workspace.op.active_complexity.ToString() + "\n";
            result += workspace.op.active_range_first.ToString() + " " + workspace.op.active_range_second.ToString() + "\n";
            result += workspace.op.active_algebra_middle_round.ToString() + "\n";
            for (int i = 0; i < 16; i++)
            {
                result += workspace.op.custom_colors[i] + " ";
            }
            result += "\n";

            return result;
        }
예제 #13
0
 public static void opens_string_for_save_conf(string input, Workspace workspace)
 {
     string[] str_arr = input.Split('\n');
     string[] temp = str_arr[0].Split(' ');
     workspace.field_ex.width = int.Parse(temp[0]);
     workspace.field_ex.heigth = int.Parse(temp[1]);
     workspace.op.game_mod = (Workspace.options.g_mod)Enum.Parse(typeof(Workspace.options.g_mod), str_arr[1]);
     temp = str_arr[2].Split(',');
     workspace.op.addition_act = bool.Parse(temp[0]);
     workspace.op.subtraction_act = bool.Parse(temp[1]);
     workspace.op.division_act = bool.Parse(temp[2]);
     workspace.op.multiplication_act = bool.Parse(temp[3]);
     workspace.op.active_fractions_mode = (Workspace.options.fractions)Enum.Parse(typeof(Workspace.options.fractions), str_arr[3]);
     workspace.op.active_complexity = (Workspace.options.complexity)Enum.Parse(typeof(Workspace.options.complexity), str_arr[4]);
     temp = str_arr[5].Split(' ');
     workspace.op.active_range_first = int.Parse(temp[0]);
     workspace.op.active_range_second = int.Parse(temp[1]);
     workspace.op.active_algebra_middle_round = (Workspace.options.algebra_middle_round)Enum.Parse(typeof(Workspace.options.algebra_middle_round), str_arr[6]);
     temp = str_arr[7].Split(' ');
     for (int i = 0; i < 16; i++)
     {
         workspace.op.custom_colors[i] = int.Parse(temp[i]);
     }
 }
예제 #14
0
 public Options()
 {
     InitializeComponent();
     workspace_ob = new Workspace();
 }
예제 #15
0
 public static void opens_string_for_save_plt(string input, Workspace workspace)
 {
     
     string[] temp = input.Split(' ');
     int count = int.Parse(temp[0]);
     for (int i = 1; i <= count; i++)
     {
         string[] str = temp[i].Split(',');
         int a = int.Parse(str[0]);
         int r = int.Parse(str[1]);
         int g = int.Parse(str[2]);
         int b = int.Parse(str[3]);
         Color myRgbColor = new Color();
         myRgbColor = Color.FromArgb(a, r, g, b);
         workspace.keys.Add(new Workspace.key("", myRgbColor));
     }
 }
예제 #16
0
        public static string saves_string_for_save_plt(Workspace workspace)
        {
            string result = "";
            result += workspace.keys.Count.ToString() + " ";
            for (int i = 0; i < workspace.keys.Count; i++)
            {
                result += workspace.keys[i].clr.A.ToString() + ",";
                result += workspace.keys[i].clr.R.ToString() + ",";
                result += workspace.keys[i].clr.G.ToString() + ",";
                result += workspace.keys[i].clr.B.ToString() + " ";
            }
            

            return result;
        }