private void Form1_Load(object sender, EventArgs e) { mi = new MapInfo.MapInfoApplication(); mi = Activator.CreateInstance(Type.GetTypeFromProgID("Mapinfo.Application")) as MapInfoApplication; int p = panel2.Handle.ToInt32(); mi.Do("set next document parent " + p.ToString() + "style 1"); mi.Do("set application window " + p.ToString()); mi.Do("run application \"" + "D:/GIS3Workspace/deneme.wor" + "\""); win_id = mi.Eval("frontwindow()"); }
private void Form2_Load(object sender, EventArgs e) { mi = new MapInfo.MapInfoApplication(); int p = panel1.Handle.ToInt32(); mi.Do("set next document parent " + p.ToString() + "style 1"); mi.Do("set application window " + p.ToString()); mi.Do("run application \"" + "C:/Users/mmhus/Desktop/dunya.wor" + "\""); mi.SetCallback(bilgiButonuD); mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"bilgiSaglayaci\" id 2001"); win_id = mi.Eval("frontwindow()"); }
private void button1_Click(object sender, EventArgs e) { removetematik(); string p = panel2.Handle.ToString(); string p4 = panel4.Handle.ToString(); int n = Convert.ToInt16(textBox1.Text); string thematic_column = string.Empty; string arac_yili = Convert.ToString(comboBox1.SelectedItem); string arac_tipi = Convert.ToString(comboBox2.SelectedItem); string sorgu1 = arac_tipi + arac_yili; try { mi.Do("Add Column \"Iller\" (" + sorgu1 + " Integer)From data1 Set To " + sorgu1 + " Where COL2 = COL1 Dynamic"); } catch { } thematic_column = sorgu1; mi.Do("select " + sorgu1 + " from Iller order by " + sorgu1 + " into sel"); //tematik oluşturma int range = Convert.ToInt16(mi.Eval("int(tableinfo(sel,8)/" + Convert.ToString(n) + ")")); int c_range = Convert.ToInt16(255 / n); //----------part 2 ----- mi.Do("fetch first from sel"); string r1 = Convert.ToString(Form1.mi.Eval("sel.col1")); string r2 = string.Empty; string cmstr = string.Empty; for (int i = 1; i < n; i++) { mi.Do("fetch rec " + Convert.ToString(i * range) + " from sel"); r2 = Convert.ToString(mi.Eval("sel.col2")); string rgb = Convert.ToString(mi.Eval("RGB(255," + Convert.ToString((n - i) * c_range) + "," + Convert.ToString((n - i) * c_range) + ")")); cmstr = cmstr + r1 + ":" + r2 + " brush(2," + rgb + ",16777215), "; r1 = r2; } mi.Do("fetch last from sel"); r2 = Convert.ToString(mi.Eval("sel.col1")); cmstr = cmstr + r1 + ":" + r2 + " brush(2,16711680,16777215)"; // ----------part 3 ----- mi.Do("shade window " + Form1.win_id + " Iller with " + thematic_column + " ranges apply all use color Brush (2,16711680,16777215) " + cmstr); mi.Do("Set Next Document Parent " + p4 + " Style 1"); mi.Do("Create Cartographic Legend From Window " + win_id + " Behind Frame From Layer 1"); Form1.mi.Do("select * from iller where plaka_no =\"82\" into sel"); Form1.mi.Do("fetch last from sel"); r2 = Convert.ToString(Form1.mi.Eval("sel.col1")); cmstr = cmstr + r1 + ":" + r2 + " brush(2,255,16777215)"; //kod sonu }
// ############################### -- TEMATIKLER -- ############################### // public void removetematik() { panel1.Focus(); for (int k = Convert.ToInt16(mi.Eval("mapperinfo(" + win_id + ",9)")); k > 0; k = k - 1) { if (Convert.ToInt16(mi.Eval("layerinfo(" + win_id + "," + Convert.ToString(k) + ",24)")) == 3) { mi.Do("remove map layer \"" + mi.Eval("layerinfo(" + win_id + "," + Convert.ToString(k) + ",1)") + "\""); } } }
private void button5_Click(object sender, EventArgs e) { mi.Do("run menu command 1706"); }
private void Form1_Load(object sender, EventArgs e) { mi = new MapInfo.MapInfoApplication(); //mi = Activator.CreateInstance(Type.GetTypeFromProgID("Mapinfo.Application")) as MapInfoApplication; int p = panel1.Handle.ToInt32(); mi.Do("set next document parent " + p.ToString() + "style 1"); mi.Do("set application window " + p.ToString()); mi.Do("run application \"" + "d:/OLE7.wor" + "\""); mi.Do("Add Column \"Iller\" (tuketim Decimal (20, 3))From Elektrik_Uretim_Tuketim Set To Elektrik_Uretim Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (uretim Decimal (20, 3))From Elektrik_Uretim_Tuketim Set To Elektrik_Tuketim Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (kayip_kacak Decimal (20, 1))From Kayip_Kacak Set To Il_KK_Oran Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (gunes Decimal (20, 1))From Ortalama_Gunes_Suresi Set To Ortalama_Gunes_Suresi Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (uretim_tuketim_oran Float)From Elektrik_Uretim_Tuketim Set To Elektrik_Tuketim/Elektrik_Uretim Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (tuketim_uretim_oran Float)From Elektrik_Uretim_Tuketim Set To Elektrik_Uretim/Elektrik_Tuketim Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (bolge_kayip_kacak Decimal (20, 1))From Kayip_Kacak Set To Bolge_KK_Oran Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (kayip_kacak_enerji Decimal (20, 1))From Kayip_Kacak Set To Kayip_Kacak_Enerji Where COL2 = COL1 Dynamic"); mi.Do("Add Column \"Iller\" (bolge_no Float)From Kayip_Kacak Set To Bolge_No Where COL2 = COL1 Dynamic"); win_id = mi.Eval("frontwindow()"); mi.SetCallback(callb); mi.Do("create buttonpad \"a\" as toolbutton calling OLE \"info\" id 2001"); }