public void OnPersonSelected(object sender, EventArgs e) { _model.GroupPersonsByCreator(); if (_view.SelectedPersonIndex >= 0 && _view.SelectedPersonIndex < _data.GetPersonsCount()) { _model.CurrentPerson = _view.SelectedPerson; _view.NameSurname = _model.CurrentPerson.Name; _view.BirthDate = DateTime.Parse(_model.CurrentPerson.BirthDate); _view.MissingDate = DateTime.Parse(_model.CurrentPerson.MissingDate); _view.AdditionalInfo = _model.CurrentPerson.AdditionalInfo; // to do: something... string chosenName = _model.CurrentPerson.Name; chosenName = chosenName.Replace(" ", "_"); // _view.PersonImage = ImageHandler.LoadRepresentativePic(chosenName); Bitmap originalBmp = (Bitmap)Image.FromFile(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + Settings.Default.DataFolderPath + Settings.Default.ImagesFolderPath + "Aurimas_Skorupskas/1.bmp");//load the image file PointF firstLocation = new PointF(10f, 10f); Bitmap tempBitmap = new Bitmap(originalBmp); using (Graphics graphics = Graphics.FromImage(tempBitmap)) { using (Font arialFont = new Font("Arial", 10)) { graphics.DrawString("Testas", arialFont, Brushes.Blue, firstLocation); } } // tempBitmap.Save(Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName + // Settings.Default.DataFolderPath + Settings.Default.ImagesFolderPath + "Aurimas_Skorupskas/1.bmp");//save the image file _view.PersonImage = tempBitmap; } }
public void OnPersonSelected(object sender, EventArgs e) { GMapMarker marker; if (_view.SelectedPersonIndex >= 0 && _view.SelectedPersonIndex < _data.GetPersonsCount()) { _model.CurrentPerson = _view.SelectedPerson; _view.Map.Position = new PointLatLng(_model.CurrentPerson.CoordX, _model.CurrentPerson.CoordY); marker = new GMarkerGoogle(new PointLatLng(_model.CurrentPerson.CoordX, _model.CurrentPerson.CoordY), GMarkerGoogleType.blue_pushpin); marker.ToolTipText = _model.CurrentPerson.Name + "\n" + _model.CurrentPerson.BirthDate + "\n" + _model.CurrentPerson.MissingDate + "\n" + _model.CurrentPerson.AdditionalInfo; markers.Markers.Add(marker); _view.Map.Overlays.Add(markers); } marker = null; }