Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Both the Icon and IconList properties allow you to establish a frame count. The frame count is used to determine how the loaded image file is divided into a list of smaller images, or frames. The easiest way to see this is by example. Here is a single image file, 288 pixels wide and 27 pixels tall.


Image file.pngImage RemovedImage Added


This image clearly has nine icons in it, but the SRP Button Control doesn't know that. So, we set the frame count to 9. In so doing, the SRP Button Control divides the width of the whole image by 9 and those are the frame. In this case, setting the frame count to 9 results in 9 32-pixel wide images.

...

When we view the button, we see only the first of the nine icons on the button face:


Button Example 1.pngImage RemovedImage Added


Here's what happens when we load the sample image but forget to set the frame count to 9:

Button Example 2.pngImage RemovedImage Added


The entire 288 pixel wide image is centered on the button. Now the we understand how icons are divided, let's explore how the frames are used by the button.

...

The SRP Button Control has up to nine states, so you can supply up to nine frames in your image:


Button 9 Frames.pngImage RemovedImage Added


The table below shows which frame applies to each state:

...