Using image brushes

Contents[Hide]

1. Overview

Color-based properties of visualizations, components, and other design elements often are actually 'brushes' which can be any of the following brush types:

  • Solid Color
  • Linear Gradient
  • Radial Gradient
  • Image
  • Hatching

The image brush type in particular allows a button, for example, to be displayed as an image that you can specify instead of a solid color. You can also use this option to create customized state indicator states based on images.

2. Using an image brush

For this example, create a new dashboard and add a Button component from the toolbar.

Go to the Properties for the button, expand Lines & Fills (or the Look tab), and then open the additional Rest Background property options.

Open Rest Background property options
Open Rest Background property options

This property determines the background color of the button when at rest (no user interaction).

Click the Brush dropdown and set it to Image, which loads a placeholder image by default and updates the button accordingly.

A placeholder image is loaded by default
A placeholder image is loaded by default

Next, customize the image brush as described in the following sections.

2.1. Source

There are two options for specifying the image source: you can set Source to a URL that points to an image (e.g., https://www.example.com/images/image1.png), or you can select an image resource uploaded to the application.

To use an image resource, click the Select button. 

Select an existing image resource
Select an existing image resource

In the Open dialog, you can right-click the Images folder to upload a new one. Select one of the listed image resources and click Open to continue.

The button is now displayed as an image on the canvas. In the Properties window, you can see a small preview of the loaded image as well. You can now clear the text displayed by the button if you want to display only the image, and optionally set an ARIA Label instead.

The image resource is loaded into the button
The image resource is loaded into the button

In the case of an image resource, the Source setting looks like this:

dundasImageResource:e0011d1d-62ac-4d81-b532-287287741f14

The portion of the above text after the colon is the ID of the image resource (which you can also get from the image resource's properties).

2.2. Size

The Size setting offers the following options:

  • Auto - The image size is automatically determined.
  • Cover - The image is sized so that it covers the available content area.
  • Contain - The image is sized so that it is contained within the available content area.
  • Fill - The image is stretched to fill the content area without taking the aspect ratio into consideration.

2.3. Repeat

The Repeat setting specifies how the image will be repeated within the content area. There are two options:

  • Repeat
  • No Repeat

Note
The Repeat option may work differently depending on the type of component or element. For CSS-based components (such as the background of a label, or the dashboard itself), the repeat option first scales according to the Size setting, and then repeats based on that. For SVG-based controls (such as a rectangle), the repeat option ignores the Size setting, always starts at (0,0), and repeats based on the original size of the image.

3. See also

 

Dundas Data Visualization, Inc.
400-15 Gervais Drive
Toronto, ON, Canada
M3C 1Y8

North America: 1.800.463.1492
International: 1.416.467.5100

Dundas Support Hours:
Phone: 9am-6pm, ET, Mon-Fri
Email: 7am-6pm, ET, Mon-Fri