This project is read-only.
1
Vote

Point symbol in code

description

With the code bellow I am trying to set bitmap for point type layer. When used ICO file for that MW5 stopped working!?
When used BMP, PNG, ... file, legend and the map shows this layer correctly! But when I click on this layer in the legend to change, for example point size, MW5 immediately stopped working.
        string fn = @"c:\mapgis\shp\it.shp";
        int handle = -1;

        var fs = new FeatureSet(fn);
        handle = _context.Layers.Add(fs);       

        fs.Style.Marker.Size = 8;
        fs.Style.Marker.SetVectorMarker(Api.Enums.VectorMarker.Circle);

        if (fs.Categories.GenerateUniqueValues("SKL"))
        {
            foreach (var ct in fs.Categories)
            {
                if (ct.Name == "VALVE")
                {
                    //string f = @"c:\pic\VALVE_RED.ico";   // MW5 crashed
                    string f = @"c:\pic\VALVE_BLUE.bmp";  // OK, but legend click chrashed MW5

                    var img = BitmapSource.Open(f, true);                   

                    // OK ampak pade če v legendi klik properties
                    ct.Style.Marker.Type = MarkerType.Bitmap;
                    ct.Style.Marker.Icon = img;
                    ct.Style.Marker.Size = 20;
        }}}

        fs.Categories.ApplyExpressions();
        _context.Map.Redraw();
Regards, Vojko

comments