Hi Val
Thank you for the above example,I have implemented and have it working, however i erratically get the following error message.
As i mentions,the error is erratic, but should i increase the TextLineSegmentRatio or decrease the GridSize it occurs more often
System.NullReferenceException was unhandled
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=WpfDesktopEdition
StackTrace:
at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.<>c__DisplayClass6.<DrawException>b__4()
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)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
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)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at MarketScopeV4.App.Main() in d:\Development\App\MarketScopeV4\MarketScopeV4\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Herewith my sample code.
IconValueStyle iconValueStyle = new IconValueStyle("Shield");
IconValueItem item1 = new IconValueItem("N", @"Resources\Shields\N.PNG", new TextStyle("SHIELDNUM", new GeoFont("Arial", 8, DrawingFontStyles.Bold), new GeoSolidBrush(GeoColor.StandardColors.White)));
item1.TextValueLengthMin = 1;
item1.TextValueLengthMax = 5;
IconValueItem item2 = new IconValueItem("M", @"Resources\Shields\W.PNG", new TextStyle("NAME", new GeoFont("Arial", 8, DrawingFontStyles.Bold), new GeoSolidBrush(GeoColor.StandardColors.White)));
item2.TextValueLengthMin = 1;
item2.TextValueLengthMax = 5;
IconValueItem item3 = new IconValueItem("R", @"Resources\Shields\GB.PNG", new TextStyle("NAME", new GeoFont("Arial", 8, DrawingFontStyles.Bold), new GeoSolidBrush(new GeoColor(255, 250, 220, 12))));
item3.TextValueLengthMin = 1;
item3.TextValueLengthMax = 5;
iconValueStyle.IconValueItems.Add(item1);
iconValueStyle.IconValueItems.Add(item2);
iconValueStyle.IconValueItems.Add(item3);
iconValueStyle.GridSize = 200;
iconValueStyle.TextLineSegmentRatio = 10;
iconValueStyle.SuppressPartialLabels = true;
Please advise