PictureFillSymbol Class

  • PictureFillSymbol
  • class Esri::ArcGISRuntime::PictureFillSymbol

    Uses an image to fill the shape of graphic and feature polygons with a repeating pattern. More...

    Header: #include <PictureFillSymbol.h>
    Since: Esri::ArcGISRuntime 100.1
    Inherits: Esri::ArcGISRuntime::FillSymbol, Esri::ArcGISRuntime::Loadable, and Esri::ArcGISRuntime::RemoteResource

    Public Functions

    PictureFillSymbol(const QImage &image, QObject *parent = nullptr)
    PictureFillSymbol(const QUrl &url, QObject *parent = nullptr)
    PictureFillSymbol(const QUrl &url, Esri::ArcGISRuntime::Credential *credential, QObject *parent = nullptr)
    virtual ~PictureFillSymbol() override
    double angle() const
    float height() const
    QImage image() const
    double offsetX() const
    double offsetY() const
    float opacity() const
    double scaleX() const
    double scaleY() const
    void setAngle(double angle)
    void setHeight(float height)
    void setOffsetX(double offsetX)
    void setOffsetY(double offsetY)
    void setOpacity(float opacity)
    void setScaleX(double scaleX)
    void setScaleY(double scaleY)
    void setWidth(float width)
    Esri::ArcGISRuntime::MultilayerPolygonSymbol *toMultilayerSymbol() const
    float width() const
    bool operator!=(const Esri::ArcGISRuntime::PictureFillSymbol &other) const
    bool operator==(const Esri::ArcGISRuntime::PictureFillSymbol &other) 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

    Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

    Symbols describe how graphics and features look on a map. Different symbols are used with different geometry types. Instances of this class represent picture fill symbols. Fill symbols are used with graphics and features that are based on Polygon geometries. The symbol defines how to fill the interior of a polygon using pictures.

    Example:

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

    const QUrl pictureFillSymbolUrl("http://static.arcgis.com/images/Symbols/Basic/YellowStickpin.png");
    PictureFillSymbol* pictureFillSymbol = new PictureFillSymbol(pictureFillSymbolUrl, this);

    See also Symbol, JsonSerializable, Loadable, and RemoteResource.

    Member Function Documentation

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

    Creates a picture fill symbol object with the given image.

    • image - The image.
    • parent - The optional parent QObject.

    Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

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

    Creates a picture fill symbol object from an image URL.

    • url - URL of the image.
    • parent - The optional parent QObject.

    Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

    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").

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

    Creates a picture fill symbol object from an image URL.

    • url - URL of the image.
    • parent - The optional parent QObject.
    • credential for the secured resource.

    Supported image formats are BMP, GIF, ICO, JPEG, and PNG. Animated GIF is not supported.

    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] PictureFillSymbol::~PictureFillSymbol()

    Destructor.

    double PictureFillSymbol::angle() const

    Returns the rotation angle of the picture fill symbol in degrees.

    The angle will rotate the symbol about its center relative to north. A positive value rotates the symbol clockwise, a negative value rotates the symbol anti-clockwise. The default value is 0.0.

    See also setAngle().

    [override virtual] void PictureFillSymbol::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 *PictureFillSymbol::credential() const

    Reimplements: RemoteResource::credential() const.

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

    [signal] void PictureFillSymbol::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.

    float PictureFillSymbol::height() const

    Returns the height of the picture fill symbol in device-independent pixels (DIPs).

    The height of the symbol spanning from the bottom to the top side of the image. The default value is 0.0. You can use this property to override the height of the symbol. Note that if you set the height or width to 0.0, then the picture fill symbol will adopt the height and width of the loaded image.

    See also setHeight().

    QImage PictureFillSymbol::image() const

    Returns the image used for the picture fill symbol to fill the polygon geometries.

    If a URL was provided for the picture fill symbol, 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 PictureFillSymbol::load()

    Reimplements: Loadable::load().

    Loads the metadata for the object asynchronously.

    Loads the metadata if the object is not loaded.

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

    Reimplements: Loadable::loadError() const.

    Returns the load error.

    See also Error.

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

    Reimplements: Loadable::loadStatus() const.

    Returns the load status.

    See also LoadStatus.

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

    Signal emitted when the load status changes for this object.

    See also Loadable.

    [since Esri::ArcGISRuntime 200.4] double PictureFillSymbol::offsetX() const

    Returns the horizontal offset of the picture fill symbol.

    Defaults to 0.0.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    See also setOffsetX().

    [since Esri::ArcGISRuntime 200.4] double PictureFillSymbol::offsetY() const

    Returns the vertical offset of the picture fill symbol.

    The default value is 0.0.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    See also setOffsetY().

    float PictureFillSymbol::opacity() const

    Returns the opacity for the picture fill symbol.

    The value ranges from 0.0 (fully transparent) to 1.0 (opaque). The default value is 1.0.

    See also setOpacity().

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

    Reimplements: RemoteResource::requestConfiguration() const.

    Returns the RequestConfiguration in use by this symbol.

    See also setRequestConfiguration().

    [override virtual] void PictureFillSymbol::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.

    double PictureFillSymbol::scaleX() const

    Returns the horizontal scaling of the picture fill symbol.

    Defaults to 1.0.

    See also setScaleX().

    double PictureFillSymbol::scaleY() const

    Returns the vertical scaling of the picture fill symbol.

    The default value is 1.0.

    See also setScaleY().

    void PictureFillSymbol::setAngle(double angle)

    Sets the angle to angle.

    See also angle.

    void PictureFillSymbol::setHeight(float height)

    Sets the height to height.

    See also height.

    [since Esri::ArcGISRuntime 200.4] void PictureFillSymbol::setOffsetX(double offsetX)

    Sets the horizontal offset of the picture fill symbol to offsetX.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    See also offsetX.

    [since Esri::ArcGISRuntime 200.4] void PictureFillSymbol::setOffsetY(double offsetY)

    Sets the vertical offset of the picture fill symbol to offsetY.

    This function was introduced in Esri::ArcGISRuntime 200.4.

    See also offsetY.

    void PictureFillSymbol::setOpacity(float opacity)

    Sets the opacity to opacity.

    See also opacity.

    [override virtual] void PictureFillSymbol::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().

    void PictureFillSymbol::setScaleX(double scaleX)

    Sets the scaleX to scaleX.

    See also scaleX.

    void PictureFillSymbol::setScaleY(double scaleY)

    Sets the scaleY to scaleY.

    See also scaleY.

    void PictureFillSymbol::setWidth(float width)

    Sets the width to width.

    See also width.

    [since Esri::ArcGISRuntime 100.13] Esri::ArcGISRuntime::MultilayerPolygonSymbol *PictureFillSymbol::toMultilayerSymbol() const

    Converts a PictureFillSymbol to a MultilayerPolygonSymbol with a PictureFillSymbolLayer.

    The resulting MultilayerPolygonSymbol contains a single PictureFillSymbolLayer.

    This function was introduced in Esri::ArcGISRuntime 100.13.

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

    Reimplements: RemoteResource::url() const.

    Returns the URL of the picture fill symbol.

    The URL is the address location of where the image is being stored. This address can come from an online source or from a locally stored location. In order to use a PictureFillSymbol from a URL, the symbol must be loaded asynchronously. Any properties that are changed while this symbol is loading will persist once the image has loaded.

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

    float PictureFillSymbol::width() const

    Returns the width of the picture fill symbol in device-independent pixels (DIPs).

    The width of the symbol spanning from the left to the right side of the image. The default value is 0.0. You can use this property to override the width of the symbol. Note that if you set the height or width to 0.0, then the picture fill symbol will adopt the height and width of the loaded image.

    See also setWidth().

    [since Esri::ArcGISRuntime 200.2] bool PictureFillSymbol::operator!=(const Esri::ArcGISRuntime::PictureFillSymbol &other) const

    Inequality operator. Returns true if this object and other are not equal.

    This function was introduced in Esri::ArcGISRuntime 200.2.

    See also PictureFillSymbol::operator==.

    [since Esri::ArcGISRuntime 200.1] bool PictureFillSymbol::operator==(const Esri::ArcGISRuntime::PictureFillSymbol &other) const

    Returns a boolean that tests if this picture fill symbol is equal to another picture fill symbol.

    • other - The picture fill symbol to be compared.

    This function was introduced in Esri::ArcGISRuntime 200.1.

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