AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ass::BackgroundImage Struct Reference

Represents textured (image) background. More...

#include <AUI/ASS/Property/BackgroundImage.h>

Public Member Functions#

 BackgroundImage (std::nullptr_t)
 
 BackgroundImage (const unset_wrap< std::variant< AString, _< IDrawable > > > &url, const unset_wrap< AColor > &overlayColor={}, const unset_wrap< Repeat > &rep={}, const unset_wrap< Sizing > &sizing={}, const unset_wrap< glm::vec2 > &scale={}, const unset_wrap< float > &dpiMargin={})
 

Signals and public fields#

unset_wrap< std::variant< AString, _< IDrawable > > > image
 Url to the image.
 
unset_wrap< AColoroverlayColor
 Multiply color filter to the image.
 
unset_wrap< Repeat > rep
 Repeating. See Repeat.
 
unset_wrap< Sizingsizing
 Sizing. See ass::Sizing.
 
unset_wrap< glm::vec2 > scale
 Scale of the image by x and y axis. Default is { 1.0, 1.0 }.
 
unset_wrap< float > dpiMargin
 DPI multiplier used to underscale or upperscale the icon.
 

Detailed Description#

Examples
examples/ui/views/src/ExampleWindow.cpp.

Member Data Documentation#

◆ dpiMargin#

unset_wrap<float> ass::BackgroundImage::dpiMargin

In example, you may use 64x64 png icons and set the dpiMargin to 2.0. They will be rendered as 32px icons on 100% scale (instead of 64px), and 64px on 200% scale, remaining crisp. On 300% scale, however, they will be rendered as 96px images, thus becoming blurry, hence usage of SVG icons is recommended.

◆ image#

unset_wrap<std::variant<AString, _<IDrawable> > > ass::BackgroundImage::image

In example, ":icon.svg" references to icon.svg file in your assets. See AUrl for more info.

◆ overlayColor#

unset_wrap<AColor> ass::BackgroundImage::overlayColor

It allows to replace the color of white icons to the specified overlayColor.

Gray color multiplied by the specified one gives the darker color.

Black color is not affected.