//------------------------------------------------------------------------ // Picture Box Events //------------------------------------------------------------------------ private void M_pbMap_MouseMove(object sender, MouseEventArgs e) { String mouseCoord = String.Format("{0}:{1} - ", e.X, e.Y); try { if (m_dialogZoom != null) { PictureBox pbZoom = m_dialogZoom.GetPictureBox(); m_dialogZoom.SetImage(m_provinceEditor.ZoomImage(e.X, e.Y, pbZoom.Width / 2, pbZoom.Height / 2)); } Color pixelColor = m_provinceEditor.BitmapMapOverlay.GetPixel(e.X, e.Y); MarkerItem markerItem = m_provinceEditor.ListMarkerItem.Find(searchItem => (pixelColor.R == searchItem.R) && (pixelColor.G == searchItem.G) && (pixelColor.B == searchItem.B)); if (markerItem != null) { m_lblLoading.Text = mouseCoord + markerItem.Name; } else { m_lblLoading.Text = mouseCoord + ""; } } catch (Exception) { } }
private void PbMap_MouseMove(object sender, MouseEventArgs e) { string mouseCoord = $"{e.X}:{e.Y} - "; try { if (m_dialogZoom != null) { PictureBox pbZoom = m_dialogZoom.GetPictureBox(); m_dialogZoom.SetImage(m_provinceEditor.ZoomImage(e.X, e.Y, pbZoom.Width / 2, pbZoom.Height / 2)); } Color pixelColor = m_provinceEditor.BitmapMapOverlay.GetPixel(e.X, e.Y); MarkerItem markerItem = m_provinceEditor.MarkerItems.Find(searchItem => (pixelColor.R == searchItem.R) && (pixelColor.G == searchItem.G) && (pixelColor.B == searchItem.B)); if (markerItem != null) { m_lblLoading.Text = mouseCoord + markerItem.Name; } else { m_lblLoading.Text = mouseCoord + ""; } } finally { } }