Hi,
There is an error message on pc’s customer like :
Source:
System.Drawing.Bitmap
Message: Parameter is not valid.
Trace:
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat
format)
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height)
at ThinkGeo.MapSuite.WpfDesktopEdition.LayerOverlay.DrawTileCore(Tile
tile, RectangleShape targetExtent)
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.DrawTile(Tile tile,
RectangleShape targetExtent)
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.8hQ=(RectangleShape
8xQ=)
at ThinkGeo.MapSuite.WpfDesktopEdition.TileOverlay.DrawCore(RectangleShape
targetExtent, OverlayRefreshType overlayRefreshType)
at
ThinkGeo.MapSuite.WpfDesktopEdition.LayerOverlay.DrawCore(RectangleShape
targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.Overlay.Draw(RectangleShape
targetExtent, OverlayRefreshType refreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.BRc=(Overlay Bhc=,
RectangleShape Bxc=, OverlayRefreshType CBc=, TimeSpan CRc=, BufferTimeType
Chc=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.9BY=(IEnumerable`1 9xY=,
RectangleShape /BY=, OverlayRefreshType /RY=, TimeSpan /hY=, BufferTimeType
/xY=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.9BY=(RectangleShape 9RY=,
OverlayRefreshType 9hY=)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.DrawCore(RectangleShape
targetExtent, OverlayRefreshType overlayRefreshType)
at ThinkGeo.MapSuite.WpfDesktopEdition.WpfMap.ZoomToScale(Double
targetScale)
at
Invivo.Workspaces.Map.UcMapOccupSolWorkspace.geoPositionner(SqlGeometry
geometryBoundingBox)
at Invivo.Workspaces.Map.UcMapOccupSolWorkspace.mapOccupSol_Loaded(Object
sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target,
RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs
args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender,
RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject
root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate
callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object
source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
The difficulty is that this error message is random ;-(
A reading our log, the error appears to load the control map (mapOccupSol_Loaded) and ZoomToScale.
Below the code of the method geoPositionner :
if (spatialQueryResults.IsValid())
{
mapSiane.CurrentExtent = spatialQueryResults.GetBoundingBox();
//Cas particulier pour les postes qui ont une p’tite résolution (se positionner au min au niveau de l’échelle des occupations de sol)
if (mapSiane.CurrentScale > mapSiane.ZoomLevelSet.ZoomLevel10.Scale) mapSiane.ZoomToScale(mapSiane.ZoomLevelSet.ZoomLevel10.Scale);
mapSiane.Refresh();
//Svgde du positionnement par défaut.
if (string.IsNullOrEmpty(boundingBoxInit)) ParameterManager.SetParameter(“BoundingBox_” + Session.Current.Etat.ExploitationId, mapSiane.CurrentExtent.GetWellKnownText());
}
Is the error may come from the cache ? or zoomToScale ? or other ?
Thanks for your help.
Regards
Steph.
Error message (System.Drawing.Bitmap Message: Parameter is not valid)
Hi Steph,
You’re right, that’s not easy to reproduced and it’s not easy to find the reason from the stack trace.
The message said: Parameter is not valid, and I found you call mapSiane.Refresh after mapSiane.ZoomToScale, so I guess maybe that caused by duplication refresh and some source haven’t been released, because when we call ZoomToScale, it call Refresh internal.
So could you please remove mapSiane.Refresh and watch whether this exception still will be thrown? If it still be thrown, I think we need create a sample for reproduce that first.
Regards,
Don