PHPPowerPoint_Shared
[ class tree: PHPPowerPoint_Shared ] [ index: PHPPowerPoint_Shared ] [ all elements ]

Source for file Drawing.php

Documentation is available at Drawing.php

  1. <?php
  2. /**
  3.  * PHPPowerPoint
  4.  *
  5.  * Copyright (c) 2009 - 2010 PHPPowerPoint
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2.1 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the Free Software
  19.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  20.  *
  21.  * @category   PHPPowerPoint
  22.  * @package    PHPPowerPoint_Shared
  23.  * @copyright  Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
  24.  * @license    http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt    LGPL
  25.  * @version    0.1.0, 2009-04-27
  26.  */
  27.  
  28.  
  29. /**
  30.  * PHPPowerPoint_Shared_Drawing
  31.  *
  32.  * @category   PHPPowerPoint
  33.  * @package    PHPPowerPoint_Shared
  34.  * @copyright  Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
  35.  */
  36. {
  37.     /**
  38.      * Convert pixels to EMU
  39.      *
  40.      * @param     int $pValue    Value in pixels
  41.      * @return     int            Value in EMU
  42.      */
  43.     public static function pixelsToEMU($pValue 0{
  44.         return round($pValue 9525);
  45.     }
  46.     
  47.     /**
  48.      * Convert EMU to pixels
  49.      *
  50.      * @param     int $pValue    Value in EMU
  51.      * @return     int            Value in pixels
  52.      */
  53.     public static function EMUToPixels($pValue 0{
  54.         if ($pValue != 0{
  55.             return round($pValue 9525);
  56.         else {
  57.             return 0;
  58.         }
  59.     }
  60.     
  61.     /**
  62.      * Convert pixels to points
  63.      *
  64.      * @param     int $pValue    Value in pixels
  65.      * @return     int            Value in points
  66.      */
  67.     public static function pixelsToPoints($pValue 0{
  68.         return $pValue 0.67777777;
  69.     }
  70.     
  71.     /**
  72.      * Convert points width to pixels
  73.      *
  74.      * @param     int $pValue    Value in points
  75.      * @return     int            Value in pixels
  76.      */
  77.     public static function pointsToPixels($pValue 0{
  78.         if ($pValue != 0{
  79.             return $pValue 1.333333333;
  80.         else {
  81.             return 0;
  82.         }
  83.     }
  84.  
  85.     /**
  86.      * Convert degrees to angle
  87.      *
  88.      * @param     int $pValue    Degrees
  89.      * @return     int            Angle
  90.      */
  91.     public static function degreesToAngle($pValue 0{
  92.         return (int)round($pValue 60000);
  93.     }
  94.     
  95.     /**
  96.      * Convert angle to degrees
  97.      *
  98.      * @param     int $pValue    Angle
  99.      * @return     int            Degrees
  100.      */
  101.     public static function angleToDegrees($pValue 0{
  102.         if ($pValue != 0{
  103.             return round($pValue 60000);
  104.         else {
  105.             return 0;
  106.         }
  107.     }
  108. }

Documentation generated on Sat, 25 Apr 2009 11:37:06 +0200 by phpDocumentor 1.4.1