Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: ApplyExpressions in 4.9

$
0
0
Thanks for the reply Paul.

Here is a simplified version of what we are doing (this is still just as slow). Please note, the bit before the "ApplyExpressions" statement is quick to execute, so that isn't the bottleneck.
                MapWinGIS.ShapefileCategories shpcat = new MapWinGIS.ShapefileCategories();
                var iconPath = Application.StartupPath + @"\MapIcons";
                string[] files = System.IO.Directory.GetFiles(iconPath);
                sf.Categories.Clear();

                foreach (string file in files.Distinct())  // there are about 70 of these
                {
                    string name = Path.GetFileNameWithoutExtension(file);
                    if (Path.GetExtension(file).ToLower() == ".png")
                    {
                        MapWinGIS.Image img = new MapWinGIS.Image();
                        if (img.Open(file, MapWinGIS.ImageType.USE_FILE_EXTENSION, true, null))
                        {
                            img.TransparencyColor = RGBpack.ColorToUInt(System.Drawing.Color.Yellow);
                            img.TransparencyColor2 = RGBpack.ColorToUInt(System.Drawing.Color.Yellow);
                            img.TransparencyPercent = 0.0;
                            img.UseTransparencyColor = true;

                            MapWinGIS.ShapefileCategory ct = sf.Categories.Add(name);

                            ct.Expression = "[Type] = \"" + name + "\"";                            
                            var symbol = CurrentNetwork.GetSymbolTypeFromImageName(name);                           
                           
                            ct.DrawingOptions.AlignPictureByBottom = false;
                            ct.DrawingOptions.PointType = MapWinGIS.tkPointSymbolType.ptSymbolPicture;

                            ct.DrawingOptions.Picture = img;


                        }
                    }
                }

                sf.Categories.ApplyExpressions();
Regards,

Rob H

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>