Package org.primefaces.model

Examples of org.primefaces.model.CroppedImage


        wb.attr("bgColor", cropper.getBackgroundColor(), null)
            .attr("bgOpacity", cropper.getBackgroundOpacity(), 0.6)
            .attr("aspectRatio", cropper.getAspectRatio(), Double.MIN_VALUE);
       
    if(cropper.getValue() != null) {
            CroppedImage croppedImage = (CroppedImage) cropper.getValue();
           
            int x = croppedImage.getLeft();
            int y = croppedImage.getTop();
            int x2 = x + croppedImage.getWidth();
            int y2 = y + croppedImage.getHeight();

            select = "[" + x +  "," + y + "," + x2 + "," + y2 + "]";
    }
        else if(cropper.getInitialCoords() != null) {
            select = "[" + cropper.getInitialCoords() + "]";
View Full Code Here


      BufferedImage cropped = outputImage.getSubimage(x, y, w, h);
     
      ByteArrayOutputStream croppedOutImage = new ByteArrayOutputStream();
          ImageIO.write(cropped, format, croppedOutImage);
         
          return new CroppedImage(cropper.getImage(), croppedOutImage.toByteArray(), x, y, w, h);
           
    } catch (IOException e) {
      throw new ConverterException(e);
    }
  }
View Full Code Here

        if(cropper.getBackgroundOpacity() != 0.6) writer.write(",bgOpacity:" + cropper.getBackgroundOpacity());
        if(cropper.getAspectRatio() != Double.MIN_VALUE) writer.write(",aspectRatio:" + cropper.getAspectRatio());

        //Initial crop area
    if(cropper.getValue() != null) {
            CroppedImage croppedImage = (CroppedImage) cropper.getValue();
           
            int x = croppedImage.getLeft();
            int y = croppedImage.getTop();
            int x2 = x + croppedImage.getWidth();
            int y2 = y + croppedImage.getHeight();

      writer.write(",setSelect:[" + x +  "," + y + "," + x2 + "," + y2 + "]");

    } else if(cropper.getInitialCoords() != null) {
            writer.write(",setSelect:[" + cropper.getInitialCoords() + "]");
View Full Code Here

      BufferedImage cropped = outputImage.getSubimage(x, y, w, h);
     
      ByteArrayOutputStream croppedOutImage = new ByteArrayOutputStream();
          ImageIO.write(cropped, format, croppedOutImage);
         
          return new CroppedImage(cropper.getImage(), croppedOutImage.toByteArray(), x, y, w, h);
           
    } catch (IOException e) {
      throw new ConverterException(e);
    }
  }
View Full Code Here

    writer.write("YAHOO.util.Event.addListener(window, 'load', function() {\n");
    writer.write(cropperVar + " = new YAHOO.widget.ImageCropper('" + getImageId(clientId) + "'");

    if(cropper.getValue() != null) {
      writer.write(",{");
      CroppedImage croppedImage = (CroppedImage) cropper.getValue();
      writer.write("initialXY:[" + croppedImage.getLeft() + "," + croppedImage.getTop() + "]");
      writer.write(",initWidth:" + croppedImage.getWidth());
      writer.write(",initHeight:" + croppedImage.getHeight());
      writer.write("}");
    }
    writer.write(");\n");

    writer.write(cropperVar + ".on('moveEvent', PrimeFaces.widget.ImageCropperUtils.attachedCroppedArea, {hiddenFieldId:\"" + getCoordsHolder(clientId) + "\"});\n");
View Full Code Here

      BufferedImage cropped = outputImage.getSubimage(x, y, w, h);
     
      ByteArrayOutputStream croppedOutImage = new ByteArrayOutputStream();
          ImageIO.write(cropped, format, croppedOutImage);
         
          return new CroppedImage(cropper.getImage(), croppedOutImage.toByteArray(), x, y, w, h);
    } catch (IOException e) {
      throw new ConverterException(e);
    }
  }
View Full Code Here

    writer.write("YAHOO.util.Event.addListener(window, 'load', function() {\n");
    writer.write(cropperVar + " = new YAHOO.widget.ImageCropper('" + getImageId(clientId) + "'");

    if(cropper.getValue() != null) {
      writer.write(",{");
      CroppedImage croppedImage = (CroppedImage) cropper.getValue();
      writer.write("initialXY:[" + croppedImage.getLeft() + "," + croppedImage.getTop() + "]");
      writer.write(",initWidth:" + croppedImage.getWidth());
      writer.write(",initHeight:" + croppedImage.getHeight());
      writer.write("}");
    }
    writer.write(");\n");

    writer.write(cropperVar + ".on('moveEvent', PrimeFaces.widget.ImageCropperUtils.attachedCroppedArea, {hiddenFieldId:\"" + getCoordsHolder(clientId) + "\"});\n");
View Full Code Here

      BufferedImage cropped = outputImage.getSubimage(x, y, w, h);
     
      ByteArrayOutputStream croppedOutImage = new ByteArrayOutputStream();
          ImageIO.write(cropped, format, croppedOutImage);
         
          return new CroppedImage(cropper.getImage(), croppedOutImage.toByteArray(), x, y, w, h);
    } catch (IOException e) {
      throw new ConverterException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.primefaces.model.CroppedImage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.