Package com.gloopics.g3viewer.client.canvas

Examples of com.gloopics.g3viewer.client.canvas.Canvas


  }

  @Override
  public void onSuccess() {
    // resize file
    Canvas upThumb = com.gloopics.g3viewer.client.canvas.Factory.getInstance().createCanvas();
    upThumb.decode(m_Blob);
   
    float imageWidth = (float)upThumb.getWidth();
    float imageHeight = (float)upThumb.getHeight();
   
    float widthRatio = imageWidth/((float)m_ResizeOptions.getMaxWidth());
    float heightRatio = imageHeight/((float)m_ResizeOptions.getMaxHeight());
   
    if (widthRatio > heightRatio){
      if (widthRatio > 1) {
        upThumb.resize(m_ResizeOptions.getMaxWidth(), (int)(imageHeight / widthRatio) );
        m_UploadFile.uploadBlob(upThumb.encode());
        return;
      }
      m_UploadFile.uploadBlob(m_Blob);
    }
    else
    {
      if (heightRatio > 1){
        upThumb.resize((int)(imageWidth / heightRatio), m_ResizeOptions.getMaxHeight());
        m_UploadFile.uploadBlob(upThumb.encode());
        return;
      }
      m_UploadFile.uploadBlob(m_Blob);
    }
  }
View Full Code Here

TOP

Related Classes of com.gloopics.g3viewer.client.canvas.Canvas

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.