original_string: public function ApplyMetricsToCanvas()
  	{
  		$destinationCanvas = @imageCreateTrueColor( $this->_metrics->frameWidth, $this->_metrics->frameHeight );
  
  		$backColor = imagecolorallocate( $destinationCanvas, 255, 255, 255 );
  
  		if( $this->_metrics->sourceFormat == 3 )
  		{
  			$backColor = imagecolorallocatealpha( $destinationCanvas, 255, 255, 255, 127 );
  			imagealphablending( $destinationCanvas, true );
  			imagesavealpha( $destinationCanvas, true );
  		}
  
  		imagefill( $destinationCanvas, 1, 1, $backColor );
  
  		@imageCopyResampled(
  			$destinationCanvas,
  			$this->GetCanvas(),
  			$this->_metrics->offsetX, $this->_metrics->offsetY, 0, 0,
  			$this->_metrics->scaleWidth, $this->_metrics->scaleHeight,
  			$this->_metrics->sourceWidth, $this->_metrics->sourceHeight );
  
  		$this->SetCanvas( $destinationCanvas );
  
  		$this->_metrics->Commit();
  	}
code: public function ApplyMetricsToCanvas()
  	{
  		$destinationCanvas = @imageCreateTrueColor( $this->_metrics->frameWidth, $this->_metrics->frameHeight );
  
  		$backColor = imagecolorallocate( $destinationCanvas, 255, 255, 255 );
  
  		if( $this->_metrics->sourceFormat == 3 )
  		{
  			$backColor = imagecolorallocatealpha( $destinationCanvas, 255, 255, 255, 127 );
  			imagealphablending( $destinationCanvas, true );
  			imagesavealpha( $destinationCanvas, true );
  		}
  
  		imagefill( $destinationCanvas, 1, 1, $backColor );
  
  		@imageCopyResampled(
  			$destinationCanvas,
  			$this->GetCanvas(),
  			$this->_metrics->offsetX, $this->_metrics->offsetY, 0, 0,
  			$this->_metrics->scaleWidth, $this->_metrics->scaleHeight,
  			$this->_metrics->sourceWidth, $this->_metrics->sourceHeight );
  
  		$this->SetCanvas( $destinationCanvas );
  
  		$this->_metrics->Commit();
  	}
code_tokens: public function ApplyMetricsToCanvas ( ) { $ destinationCanvas = @ imageCreateTrueColor ( $ this -> _metrics -> frameWidth , $ this -> _metrics -> frameHeight ) ; $ backColor = imagecolorallocate ( $ destinationCanvas , 255 , 255 , 255 ) ; if ( $ this -> _metrics -> sourceFormat == 3 ) { $ backColor = imagecolorallocatealpha ( $ destinationCanvas , 255 , 255 , 255 , 127 ) ; imagealphablending ( $ destinationCanvas , true ) ; imagesavealpha ( $ destinationCanvas , true ) ; } imagefill ( $ destinationCanvas , 1 , 1 , $ backColor ) ; @ imageCopyResampled ( $ destinationCanvas , $ this -> GetCanvas ( ) , $ this -> _metrics -> offsetX , $ this -> _metrics -> offsetY , 0 , 0 , $ this -> _metrics -> scaleWidth , $ this -> _metrics -> scaleHeight , $ this -> _metrics -> sourceWidth , $ this -> _metrics -> sourceHeight ) ; $ this -> SetCanvas ( $ destinationCanvas ) ; $ this -> _metrics -> Commit ( ) ; }
docstring: Makes sure that the current image metrics are applied to the canvas, essentially committing the
  changes.
docstring_tokens: Makes sure that the current image metrics are applied to the canvas essentially committing the changes .