Feature request (BaseDrawing::setWidthAndHeight)

Topics: Developer Forum, Project Management Forum, User Forum
Dec 11, 2007 at 7:28 AM
Edited Dec 11, 2007 at 7:34 AM
file_path : PHPExcel/Worksheet/BaseDrawing.php
/**
* @create thumb_image with set width and height
* @author Vincent@luo MSN:kele_100@hotmail.com
* @access public
* @name setWidthAndHeight
* @var $w thumb_width
* @var $h thumb_height
* @example $objDrawing->setResizeProportional(true);
* @example $objDrawing->setWidthAndHeight(160,120);
*/
public function setWidthAndHeight($w = 0,$h = 0){
$xratio = $w/$this->width;
$yratio = $h/$this->height;
if ($this->_resizeProportional && !($w ==0 || $h ==0)) {
if (($xratio * $this->height) < $h) {
$this->height = ceil($xratio * $this->_height);
$this->_width = $w;
}else {
$this->width = ceil($yratio * $this->_width);
$this->_height = $h;
}
}
}
Coordinator
Dec 13, 2007 at 7:25 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.