private void FormViewer_DragDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); if (files.Count() > 0) { try { string filePath = files[0]; FileInfo file = new FileInfo(filePath); if (!file.Exists) { return; } List <MiqobotGrid> grids = Miqobot.GetAllGridsFromFile(file); if (grids.Count <= 0) { return; } string area = grids[0].Description.Split('@')[0]; if (area.Contains("[")) { area = area.Split('[')[1].Trim(); } Dictionary <string, double> dictionaryClosestAetherytes = new Dictionary <string, double>(); gridF = new FFXIVItemGridF(); gridF.GridFile = new FileInfo(file.FullName); gridF.Analyze(ListAetherytes, ListGatheringNodes, ref dictionaryClosestAetherytes); List <FFXIVAetheryte> zoneAetherytes = new List <FFXIVAetheryte>(); foreach (FFXIVAetheryte aetherythe in ListAetherytes) { if (null == aetherythe) { continue; } if (aetherythe.GetMapName().Contains(area)) { zoneAetherytes.Add(aetherythe); } } gridF.BuildPicture(zoneAetherytes); pictureBox1.BackColor = Color.White; pictureBox1.BackgroundImage = gridF.Picture; pictureBox1.BackgroundImageLayout = ImageLayout.Zoom; } catch (Exception exc) { Console.WriteLine(exc.Message); } } }
private void _displayGridButton_Click(object sender, EventArgs e) { if (null == _gridListView) { return; } if (null == _gridListView.SelectedItems) { return; } if (0 >= _gridListView.SelectedItems.Count) { return; } ListViewItem selectedItem = _gridListView.SelectedItems[0]; if (null == selectedItem) { return; } if (null == selectedItem.Tag) { return; } try { FFXIVItemGridF gridF = selectedItem.Tag as FFXIVItemGridF; gridF.BuildPicture(); Form form = new Form(); form.Text = "Grid Bitmap"; PictureBox pictureBox = new PictureBox(); pictureBox.BackgroundImageLayout = ImageLayout.Zoom; pictureBox.Dock = DockStyle.Fill; pictureBox.BackgroundImage = gridF.Picture; form.Controls.Add(pictureBox); form.Show(); form.WindowState = FormWindowState.Maximized; } catch (Exception exc) { Console.WriteLine(exc.Message); } }
private void FormViewer_DragDrop(object sender, DragEventArgs e) { string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); if (files.Count() > 0) { try { string filePath = files[0]; FileInfo file = new FileInfo(filePath); if (!file.Exists) { return; } List <MiqobotGrid> grids = Miqobot.GetAllGridsFromFile(file); if (grids.Count <= 0) { return; } Dictionary <string, double> dictionaryClosestAetherytes = new Dictionary <string, double>(); gridF = new FFXIVItemGridF(); gridF.GridFile = new FileInfo(file.FullName); gridF.Analyze(ListAetherytes, ListGatheringNodes, ref dictionaryClosestAetherytes); gridF.BuildPicture(); pictureBox1.BackColor = Color.White; pictureBox1.BackgroundImage = gridF.Picture; pictureBox1.BackgroundImageLayout = ImageLayout.Zoom; } catch (Exception exc) { Console.WriteLine(exc.Message); } } }
private void _aetheryteComboBox_SelectedIndexChanged(object sender, EventArgs e) { string gridName = _aetheryteComboBox.Text; if (null == gridF) { return; } foreach (FFXIVAetheryte aetheryte in ListAetherytes) { if (null != aetheryte && aetheryte.ToString() == gridName) { gridF.ClosestAetheryte = aetheryte; break; } } gridF.BuildPicture(); pictureBox1.BackColor = Color.White; pictureBox1.BackgroundImage = gridF.Picture; pictureBox1.BackgroundImageLayout = ImageLayout.Zoom; }