You are here: Docs Technical Documentation Configuring Widgets Creating screenshots of configurable widgets

Creating screenshots of configurable widgets

How to create screenshots of configurable widgets

A Widget Creator can generate screenshots that reflect the configured state of their widgets by requesting an URL. The generic URL is:

http://img.clearspring.com/widgets/WID/NAME/VALUE/imgWIDTHxHEIGHT.FORMAT

the /NAME/VALUE pairs, in the URL, are the parameter names as defined on the widget. They must be entered exactly the same as they were defined in the Clearspring widget console, for example, playerId is not the same as playerID.

The WIDTH and HEIGHT is the size of the image, in pixels, to create from the widget.  The image scales per the aspect ratio of the widget, so as to not clip the image adjust the size wanted accordingly.  The value for WIDTH and HEIGHT can be between 1 and 900 pixels,

The value of FORMAT is the image type to generate.  You can specify .PNG, .JPG or .GIF.

  • PNG has the best quality, but it a tiny bit larger than other format.
  • JPG is sometimes smaller than PNG.
  • GIF has only 256 colors.

The Widget Creator will use this same URL to display the screenshot after it has been created. (Note that there could be a few second delay, for generation, between the initial request and the screenshot being able to be viewed.)

For example the URL:

http://img.clearspring.com/widgets/471e64ebe7e/bodyType/14/img90x90.png

would generate a square 90x90 image of the widget with a specific body type.  To use this image on a Web page, the Widget Create would use an HTML tag like:

<img src="http://img.clearspring.com/widgets/471e64ebe7e/bodyType/14/img90x90.png" alt="Body A Widget" />

When there are 2 or more parameters, they must be listed in alphabetical order. For example:

http://img.clearspring.com/widgets/471e64ebe7e/areaID/65/bodyType/14/img90x90.png