1. Interop libraries. In order to use MapWinGIS in .NET environment 2 interop assemblies (wrappers) must be generated: AxInteriop.MapWinGIS.dll and Interop.MapWinGIS dll. Visual Studio generates these assemblies automatically in the process of adding AxMap control on the form. Tlbimp.exe and Aximp.exe command line utilities can be used to do the same tasks manually.
2. Passing colors. The OLE_COLOR data type used by MapWinGIS is mapped to UInt32 in .NET, which doesn't provide immediate means for specification of colors using System.Drawing.Color class. The following 2 approaches can be used.
Shapefile sf = new Shapefile(); //1. ColorTranslator class can be used to do the job sf.DefaultDrawingOptions.FillColor = Convert.ToUInt32(ColorTranslator.ToOle(Color.Red)); //2. there is ColorByName method of the Utils class Utils utils = new Utils(); sf.DefaultDrawingOptions.FillColor = utils.ColorByName(tkMapColor.Red);
3. Consuming the variant data type. .NET doesn't have data type equivalent to COM VARIANT. Therefore arguments of of variant type are converted to the object data type. Variant parameters can be used in the following scenarios:
Use the documenataion to find out the data type the output values should be cast to on the .NET side.
MapWindow 4 is the largest application build upon MapWinGIS (http://www.mapwindow.org).
1.7.6.1