Show Menu
TOPICS×

align

Align Image with View. Aligns the composite image (possibly after scaling, if scl= is specified as well) within the view rectangle defined by wid= and hei=.
align= * horiz *, * vert *
horiz
horizontal alignment (real, -1.0…1.0)
vert
vertical alignment (real, -1.0…1.0)
Specify align=-1,-1 to align the top-left of the composite image with the top-left of the view, specify align=1,1 to align the bottom, right of the image with the bottom right of the view. For standard image and thumbnail requests, any area of the view which is not covered by composite image data is filled with bgc= .

Properties

View attribute. ( align= is also used to define the alignment between a watermark image and the composite image to which the watermark is applied.) Applies regardless of current layer setting. Ignored if only one of wid= and hei= is specified and when fit=constrain or fit=stretch .

Default

align=0,0 , which centers the image in the view rectangle.

Example

The following request fits myImage into a 200x200 pixel view rectangle.
http://server/myRootId/myImageId?wid=200&hei=200&align=0,-1
If myImage is exactly square, it fills the entire view rectangle. If myImage has a portrait aspect ratio, it is scaled to be 200 pixels tall and is centered horizontally in the view. If myImage has a landscape aspect ratio, it is scaled to be 200 pixels wide and is aligned to the top edge of the view. In all cases, the image returned is exactly 200x200 pixels in size; any space not covered by the scaled myImage is filled with attribute::BkgColor (specify bgc= to control the background color dynamically).