private void RestoreLocator(MapWin4Project project) { if (project.MapWindow == null || project.MapWindow.PreviewMap == null) { return; } var xmlPreview = project.MapWindow.PreviewMap; var bitmap = _imageSerializationService.ConvertStringToImage(xmlPreview.Image.Value, xmlPreview.Image.Type); double dx = NumericHelper.Parse(xmlPreview.Dx, 1.0); double dy = NumericHelper.Parse(xmlPreview.Dy, 1.0); double xll = NumericHelper.Parse(xmlPreview.XllCenter, 0.0); double yll = NumericHelper.Parse(xmlPreview.YllCenter, 0.0); _context.Locator.RestorePicture(bitmap as System.Drawing.Image, dx, dy, xll, yll); }