Examples of AImage


Examples of org.zkoss.image.AImage

      if (isPreview()) {
        if (getContentType() != null) {
          if (getContentType().startsWith("image")) {
            InputStream input = Medias.asStream(media);
            imagePreview.setVisible(true);
            image.setContent(new AImage(getName(), input));
            input.close();
            adjustImage();
          }
          if (isContentTypeEditable()) {
            codemirror.setVisible(true);
View Full Code Here

Examples of org.zkoss.image.AImage

            throw new UiException("captcha must specify height");
               
          try {
            //generate the distorted image based on the given text value
            byte[] bytes = getCaptchaEngine().generateCaptcha(Captcha.this);
            final AImage image = new AImage("captcha"+new Date().getTime(), bytes);
            setContent(image);
          } catch(java.io.IOException ex) {
            throw UiException.Aide.wrap(ex);
          } finally {
            _smartDrawCaptcha = false;
View Full Code Here

Examples of org.zkoss.image.AImage

     
    if (Strings.isBlank(getHeight()))
      throw new UiException("chart must specify height");
     
    try {
      final AImage image = new AImage("chart"+new Date().getTime(), getEngine().drawChart(Chart.this));
      setContent(image);
    } catch(java.io.IOException ex) {
      throw UiException.Aide.wrap(ex);
    } finally {
      _smartDrawChart = false;
View Full Code Here

Examples of org.zkoss.image.AImage

  float quality, boolean encodeAlpha)
  throws IOException {
    ImageEncoder encoder = ImageEncoders.newInstance(getFormat(name));
    encoder.setQuality(quality);
    encoder.setEncodingAlpha(encodeAlpha);
    return new AImage(name, encoder.encode(image));
  }
View Full Code Here

Examples of org.zkoss.image.AImage

     * extension with supported format.
   */
  public static Image encode(String name, RenderedImage image)
  throws IOException {
    ImageEncoder encoder = ImageEncoders.newInstance(getFormat(name));
    return new AImage(name, encoder.encode(image));
  }
View Full Code Here

Examples of org.zkoss.image.AImage

    }

    if (!alwaysNative && ctypelc != null) {
      if (ctypelc.startsWith("image/")) {
        try {
          return fi.isInMemory() ? new AImage(name, fi.get()):
            new AImage(name, fi.getInputStream());
              //note: AImage converts stream to binary array
        } catch (Throwable ex) {
          if (log.debugable()) log.debug("Unknown file format: "+ctype);
        }
      } else if (ctypelc.startsWith("audio/")) {
View Full Code Here

Examples of org.zkoss.image.AImage

      PiePlot plot = (PiePlot) chart.getPlot();
      plot.setForegroundAlpha(0.5f);
      BufferedImage bi = chart.createBufferedImage(chartWidth, chartHeight, BufferedImage.TRANSLUCENT, null);
      byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);

      AImage chartImage = new AImage("Pie Chart", bytes);

      Image img = new Image();
      img.setContent(chartImage);
      img.setParent(div_chartArea);
View Full Code Here

Examples of org.zkoss.image.AImage

      PiePlot3D plot = (PiePlot3D) chart.getPlot();
      plot.setForegroundAlpha(0.5f);
      BufferedImage bi = chart.createBufferedImage(chartWidth, chartHeight, BufferedImage.TRANSLUCENT, null);
      byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);

      AImage chartImage = new AImage("Pie Chart", bytes);

      Image img = new Image();
      img.setContent(chartImage);
      img.setParent(this.div_chartArea);
View Full Code Here

Examples of org.zkoss.image.AImage

      RingPlot plot = (RingPlot) chart.getPlot();
      plot.setForegroundAlpha(0.5f);
      BufferedImage bi = chart.createBufferedImage(chartWidth, chartHeight, BufferedImage.TRANSLUCENT, null);
      byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);

      AImage chartImage = new AImage("Ring Chart", bytes);

      Image img = new Image();
      img.setContent(chartImage);
      img.setParent(this.div_chartArea);
View Full Code Here

Examples of org.zkoss.image.AImage

      plot.setForegroundAlpha(0.5f);

      BufferedImage bi = chart.createBufferedImage(chartWidth, chartHeight, BufferedImage.TRANSLUCENT, null);
      byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);

      AImage chartImage = new AImage("Bar Chart", bytes);

      Image img = new Image();
      img.setContent(chartImage);
      img.setParent(div_chartArea);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.