• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

ImageRotateAndResize

The ImageRotateAndResize widget rotates or resizes images and provides events to catch the new image values on the server side. It uses the HTML5 Canvas.

ImageRotateAndResize Tag Documentation

ImageRotateAndResize allows rotating and resizing an image.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
for String true Search expression for the target image.
Tag Documentation Widget Source
Basic Usage

The widget provides client side methods which can be called with JavaScript: rotateLeft(degree), rotateRight(degree), resize(width,height), scale(scaleFactor) and restoreDefaults(). The events rotate and resize are sent to the server.


Usage


<div class="card">
    <h5>Basic Usage</h5>
    <p>The widget provides client side methods which can be called with JavaScript: <code>rotateLeft(degree)</code>,
        <code>rotateRight(degree)</code>, <code>resize(width,height)</code>, <code>scale(scaleFactor)</code> and
        <code>restoreDefaults()</code>. The events <i>rotate</i> and <i>resize</i> are sent to the server.</p>
    <h:form id="formBasicUsage">
        <p:growl id="growl" showDetail="true"/>

        <h:graphicImage id="myImage" value="/resources/images/testImage1.png"/>

        <pe:imageRotateAndResize id="rotateAndResize" for="myImage" widgetVar="rotateAndResizeWidget">
            <p:ajax event="rotate" listener="#{imageController.rotateListener}" update="growl"/>
            <p:ajax event="resize" listener="#{imageController.resizeListener}" update="growl"/>
        </pe:imageRotateAndResize>

        <br/>

        <p:commandButton icon="pi pi-replay" value="Rotate Left"
                         onclick="PF('rotateAndResizeWidget').rotateLeft(90);return false;"/>
        <p:commandButton icon="pi pi-refresh" value="Rotate Right"
                         onclick="PF('rotateAndResizeWidget').rotateRight(90);return false;"/>
        <p:commandButton icon="pi pi-search-plus" value="Scale +"
                         onclick="PF('rotateAndResizeWidget').scale(1.05);return false;"/>
        <p:commandButton icon="pi pi-search-minus" value="Scale -"
                         onclick="PF('rotateAndResizeWidget').scale(0.95);return false;"/>
    </h:form>
</div>