Context
Issue
For the symbols with the `CIMGeometricEffectControlMeasureLine` `createSwatch` doesn't work properly anymore – the bitmap returned from the function has a single diagonal line no matter what dictionary content is. Though everything worked well with the SDK 200.4. Note: map rendering still works fine, it's only the `createSwatch` function has issue.
Nothing jumps out to me why would `createSwatch` be different in 200.4. No changes went in on that front, but I am happy to take a look. Can you please share the SIDC code and the two images before and after 200.4 so I can see what is the difference?
Also another reason could the version of App6D is outdated. Where did you get the App6D stylx file from that is used in your app?
The style dictionary is custom but based on the app6d file provided here – also, it produces the same problematic behaviour described: https://www.arcgis.com/home/item.html?id=ef2f9d1d572d405ab47675679b07ccd4
As for the SIDC, it' basically any (I suspect) with the applied effect of `CIMGeometricEffectControlMeasureLine` https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/control-measure-line-symbol-e...
E.g. 10012500003423000000
Is the first one swatch/image using 200.4 and second image from 200.5 swatch?
I am trying to reproduce the behavior using App6d and the sidc code you provided and I am getting following swatch image
try
{
DictionarySymbolStyle symbolStyle = await DictionarySymbolStyle.CreateFromFileAsync("C:\\Program Files\\ArcGIS\\Pro\\Resources\\Dictionaries\\app6d\\app6d.stylx");
var cf = symbolStyle.Configurations.ToList().Find(cn => cn.Name == "model");
if (cf != null)
cf.Value = "ORDERED ANCHOR POINTS";
Dictionary<string, object> attributes = new Dictionary<string, object>
{
{ "sidc", 10012500003423000000 }
};
Symbol symbol = await symbolStyle.GetSymbolAsync(attributes);
RuntimeImage image = await symbol.CreateSwatchAsync(90, 90, 96, Color.Black);
swatch.Source = await image.ToImageSourceAsync();
}
catch (Exception ex)
{
}
}
I think I need a more concrete repro sample so I can better assist you.
> Is the first one swatch/image using 200.4 and second image from 200.5 swatch?
That is correct.
> I think I need a more concrete repro sample so I can better assist you.
Will do and keep you updated once ready.
Anyway, what you've got for the 10012500003423000000 – is wrong (see Seize App6d symbol).
Meanwhile, could you please try 10012500003401000000? This should be Mission Tasks: Block – quite a simple symbol to draw with the help of CIMGeometricEffectControlMeasureLine
Ok, I guess I understand the problem you are running into.
The problem is setting configuration to `Ordered Anchor Points` without actual control points.
The purpose of this configuration is to draw the graphic or feature using the specified control points based as geometry and the correct symbol is returned. In this case it is important that geometry passed should have correct number of control points as defined in the standard.
Since you are just trying to get a swatch and there are no features or graphics being drawn, there are two options you can choose from. Both approaches listed below are just ideas and are not a resolution to your issue.
- If you want to just get a symbol for an sidc you could try to NOT set `Ordered Anchor points` configuration. That way stylx can return you the base template symbol. But, caveat here is base template may not look like actual symbol.
- If you do want the exact symbol then you should use CreateSwatchAsync() overload that takes a geometry and for that geometry you should pass in a polyline with right number of control points. Note, I have only tried `10012500003401000000` from App6d which looked and haven't tested more complex symbols. There could be issues with this approach as well and you need to know the right number of control points, define the right coordinates and right geometry type. So this is not simple either.
try
{
DictionarySymbolStyle symbolStyle = await DictionarySymbolStyle.CreateFromFileAsync("C:\\Program Files\\ArcGIS\\Pro\\Resources\\Dictionaries\\app6d\\app6d.stylx");
var cf = symbolStyle.Configurations.ToList().Find(cn => cn.Name == "model");
if (cf != null)
cf.Value = "ORDERED ANCHOR POINTS";
Dictionary<string, object> attributes = new Dictionary<string, object>
{
{ "sidc", 10012500003401000000 }
};
IList<MapPoint> mps= new List<MapPoint>();
mps.Add(new MapPoint(30, 10));
mps.Add(new MapPoint(30, -10));
mps.Add(new MapPoint(-30, 0));
Esri.ArcGISRuntime.Geometry.Polyline mlp = new Esri.ArcGISRuntime.Geometry.Polyline(mps);
Symbol symbol = await symbolStyle.GetSymbolAsync(attributes);
RuntimeImage image = await symbol.CreateSwatchAsync(90, 90, 96, Color.Black,mlp);
swatch.Source = await image.ToImageSourceAsync();
}