PictureFillSymbolLayer Class

  • PictureFillSymbolLayer
  • class Esri::ArcGISRuntime::PictureFillSymbolLayer

    A symbol layer that fills polygon geometry with an image. More...

    Header: #include <PictureFillSymbolLayer.h>
    Since: Esri::ArcGISRuntime 100.5
    Inherits: Esri::ArcGISRuntime::FillSymbolLayer, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::RemoteResource

    Public Functions

    PictureFillSymbolLayer(const QImage &image, QObject *parent = nullptr)
    PictureFillSymbolLayer(const QUrl &url, QObject *parent = nullptr)
    PictureFillSymbolLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    virtual ~PictureFillSymbolLayer() override
    QImage image() const
    void setTintColor(const QColor &tintColor)
    QColor tintColor() const

    Reimplemented Public Functions

    virtual void cancelLoad() override
    virtual Esri::ArcGISRuntime::Credential *credential() const override
    virtual void load() override
    virtual Esri::ArcGISRuntime::Error loadError() const override
    virtual Esri::ArcGISRuntime::LoadStatus loadStatus() const override
    virtual Esri::ArcGISRuntime::RequestConfiguration requestConfiguration() const override
    virtual void retryLoad() override
    virtual void setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration) override
    virtual QUrl url() const override

    Signals

    void doneLoading(const Esri::ArcGISRuntime::Error &loadError)
    void loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Detailed Description

    The specified image fills the layer's polygon if it is the only symbol layer in a MultilayerPolygonSymbol. If a single image does not completely fill the geometry, it is tiled to complete the fill.

    This layer can also represent the Web Scene specification's Icon3DSymbolLayers. PictureFillSymbolLayer represents IconSymbol3DLayers that contain pictures and VectorMarkerSymbolLayer represents Icon3DSymbolLayers that are primitives or vector paths.

    The PictureFillSymbolLayer provides a similar user experience to the simple PictureFillSymbol, but can be used in a MultilayerSymbol.

    Example:

    Create a PictureFillSymbolLayer and set its URL to an online PNG:

    const QUrl pictureFillSymbolLayerUrl("http://static.arcgis.com/images/Symbols/Basic/YellowStickpin.png");
    PictureFillSymbolLayer* pictureFillSymbolLayer = new PictureFillSymbolLayer(pictureFillSymbolLayerUrl, this);

    See also Symbol, Loadable, and RemoteResource.

    Member Function Documentation

    [explicit] PictureFillSymbolLayer::PictureFillSymbolLayer(const QImage &image, QObject *parent = nullptr)

    Creates a picture fill symbol layer from a QImage.

    • image - the QImage indicating the desired image.
    • parent - The optional parent QObject.

    Create a PictureFillSymbolLayer with image data. The image, if valid, is set as the image used to fill the containing polygon. The function throws if the image is nullptr or empty. If the image is valid, the load status of the PictureFillSymbolLayer is set to LoadStatus::Loaded.

    [explicit] PictureFillSymbolLayer::PictureFillSymbolLayer(const QUrl &url, QObject *parent = nullptr)

    Creates a picture fill symbol layer from a URL.

    • url - indicating the URL location of the image to use in the symbol layer
    • parent - The optional parent QObject.

    Create a PictureFillSymbolLayer with an image URL. The given URL is used to retrieve the image data to use as the picture.

    The URL can be provided as a path to a local file ( "file:/<path to file>"), path to a resource image ("qrc:/<path to resource image>"), or a path to an HTTP URL image ("http://path to image").

    PictureFillSymbolLayer::PictureFillSymbolLayer(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)

    Creates a picture fill symbol layer from a URL.

    • url - indicating the URL location of the image to use in the symbol layer
    • parent - The optional parent QObject.
    • credential - the credeantial for the secured resource if the image needs authentication to gain access to it.

    Create a PictureFillSymbolLayer with an image URL. The given URL is used to retrieve the image data to use as the picture.

    The URL can be provided as a path to a local file ( "file:/<path to file>"), path to a resource image ("qrc:/<path to resource image>"), or a path to an HTTP URL image ("http://path to image").

    [override virtual] PictureFillSymbolLayer::~PictureFillSymbolLayer()

    Destructor.

    [override virtual] void PictureFillSymbolLayer::cancelLoad()

    Reimplements: Loadable::cancelLoad().

    Cancels loading metadata for the object.

    Cancels loading the metadata if the object is loading.

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Credential *PictureFillSymbolLayer::credential() const

    Reimplements: RemoteResource::credential() const.

    Returns the security credentials to access the remote resource. Only applicable if the resource is secured.

    [signal] void PictureFillSymbolLayer::doneLoading(const Esri::ArcGISRuntime::Error &loadError)

    Signal emitted when this object is done loading.

    • loadError - Details about any error that may have occurred.

    Note: If there is a load error it will also be emitted on the errorOccurred signal.

    See also Loadable and Object.

    QImage PictureFillSymbolLayer::image() const

    Returns the image held by a picture fill symbol layer.

    The QImage held by the given PictureFillSymbolLayer. Setting the image visually changes the image that makes up the fill pattern. If the image is valid and non-empty, this function sets the image and sets the symbol layer's load status to LoadStatus::Loaded. You cannot set an image on a PictureFillSymbolLayer that has already loaded.

    If a URL was provided for the picture fill symbol layer, an attempt to load the symbol must occur and succeed, before the image can be returned from this function. Prior to loading in this case, this will return a null QImage.

    Returned images are in the QImage::Format_ARGB32_Premultiplied format.

    [override virtual] void PictureFillSymbolLayer::load()

    Reimplements: Loadable::load().

    Loads the metadata for the object asynchronously.

    Loads the metadata if the object is not loaded.

    See Loadable.

    [override virtual] Esri::ArcGISRuntime::Error PictureFillSymbolLayer::loadError() const

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See Loadable.

    See also Error.

    [override virtual] Esri::ArcGISRuntime::LoadStatus PictureFillSymbolLayer::loadStatus() const

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See Loadable.

    See also LoadStatus.

    [signal] void PictureFillSymbolLayer::loadStatusChanged(Esri::ArcGISRuntime::LoadStatus loadStatus)

    Signal emitted when the load status changes for this object.

    See also Loadable.

    [override virtual] Esri::ArcGISRuntime::RequestConfiguration PictureFillSymbolLayer::requestConfiguration() const

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this symbol.

    See also setRequestConfiguration().

    [override virtual] void PictureFillSymbolLayer::retryLoad()

    Reimplements: Loadable::retryLoad().

    Loads or retries loading metadata for the object asynchronously.

    Will retry loading the metadata if the object is failed to load. Will load the object if it is not loaded. Will not retry to load the object if the object is loaded. Will always call the done loading if this is called.

    See Loadable.

    [override virtual] void PictureFillSymbolLayer::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration)

    Reimplements: RemoteResource::setRequestConfiguration(const Esri::ArcGISRuntime::RequestConfiguration &requestConfiguration).

    Sets configuration parameters used for network requests sent by this symbol to requestConfiguration.

    See also requestConfiguration().

    [since Esri::ArcGISRuntime 100.6] void PictureFillSymbolLayer::setTintColor(const QColor &tintColor)

    Sets the tintColor to tintColor.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also tintColor.

    [since Esri::ArcGISRuntime 100.6] QColor PictureFillSymbolLayer::tintColor() const

    Returns the tint color of the picture fill symbol layer.

    The tint color is applied to the entire image by multiplying each RGB color channel in the image by the corresponding color channel of the tint color. The default color is white with 100% opacity (RGBA (255, 255, 255, 255)), which when applied leaves the image with its native colors. A white tint color with opacity less than 100% tints the image white, with the reduced opacity respected.

    When getting the tint color from a symbol, the consensus value is reported. If there is no consensus (one or more layers have different colors), an empty value is reported for the color. Likewise, setting a value for tint color on a symbol will apply that tint color to all layers the symbol contains.

    This function was introduced in Esri::ArcGISRuntime 100.6.

    See also setTintColor().

    [override virtual] QUrl PictureFillSymbolLayer::url() const

    Reimplements: RemoteResource::url() const.

    Returns the URL of a picture fill symbol layer.

    The URL of the PictureFillSymbolLayer. If there is no URL set, the method returns an empty URL.

    This could be a local file path, Qt resource path, or HTTP path to the image.

    Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.