Parameters
- fileName
- Path to a png, jpg, bmp file.
- size
- The size.
/// <summary> /// Constructs a picture fill with the specified parameters. ///  /// </summary> { //Note: Run withing QueuedTask CIMStroke outline = SymbolFactory.Instance.ConstructStroke(CIMColor.CreateRGBColor(110, 110, 110), 2.0, SimpleLineStyle.Solid); //picture var imgPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Images\CaliforniaEmblem.png"); var pictureFill = SymbolFactory.Instance.ConstructPictureFill(imgPath, 64); List<CIMSymbolLayer> symbolLayers = new() { outline, pictureFill }; CIMPolygonSymbol pictureFillPolygonSymbol = new CIMPolygonSymbol() { SymbolLayers = symbolLayers.ToArray() }; //To apply the symbol to a polygon feature layer //var renderer = theLayer.GetRenderer() as CIMSimpleRenderer; //renderer.Symbol = pictureFillPolygonSymbol.MakeSymbolReference(); //theLayer.SetRenderer(renderer); }
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)