Søk i hjelpesidene:
Printer friendly version

Image scaling in user controls

In ESiteControls used to display dataobjects it is often neccessary to scale images. If you are using databinding (<%#...%> statements) remember to call the DataBind() method in your UserControl (normally in the prerender or load method).

Preview sized image

Use the GetPreviewImage(imageFile) method.

In databinding scenarios this will be something like:  <img src="<%#GetPreviewImage(Data("Image"))%>" alt="" />

Get normal display size image

Use the following function

GetImageUrl(ByVal imageFile As String)

Example:   <%#GetImageUrl(Data("Image"))%>

Using hardcoded size parameters

By adding the w, h and m parameters you can rescale any image in E-Site. This will required that you always have a predefined size that you want to target that you don't need configurable in E-Site.

Example: image.jpeg?w=1024&h=768&m=0

Parameters

w - width
h - height
m - mode (0 to 5)