当前位置: 首页>>代码示例>>PHP>>正文


PHP QApplication::ProcessOutput方法代码示例

本文整理汇总了PHP中QApplication::ProcessOutput方法的典型用法代码示例。如果您正苦于以下问题:PHP QApplication::ProcessOutput方法的具体用法?PHP QApplication::ProcessOutput怎么用?PHP QApplication::ProcessOutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QApplication的用法示例。


在下文中一共展示了QApplication::ProcessOutput方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: EvaluateTemplate

 public function EvaluateTemplate($strTemplate)
 {
     global $_ITEM;
     global $_CONTROL;
     $_FORM = $this;
     if ($strTemplate) {
         QApplication::$ProcessOutput = false;
         // Store the Output Buffer locally
         $strAlreadyRendered = ob_get_contents();
         ob_clean();
         // Evaluate the new template
         ob_start('__QForm_EvaluateTemplate_ObHandler');
         require $strTemplate;
         $strTemplateEvaluated = ob_get_contents();
         ob_end_clean();
         // Restore the output buffer and return evaluated template
         print $strAlreadyRendered;
         QApplication::$ProcessOutput = true;
         return $strTemplateEvaluated;
     } else {
         return null;
     }
 }
开发者ID:kmcelhinney,项目名称:qcodo,代码行数:23,代码来源:QFormBase.class.php

示例2: RenderImage


//.........这里部分代码省略.........
         // Step 2 - Alignment
         switch ($this->strVerticalAlign) {
             case QVerticalAlign::Top:
                 if ($blnTrueType) {
                     $intY = $intBoxHeight - $intYCoordinate2 + $this->intPaddingHeight;
                 } else {
                     $intY = $intYCoordinate2 + 2 + $this->intPaddingHeight;
                 }
                 break;
             case QVerticalAlign::Bottom:
                 if ($blnTrueType) {
                     $intY = $this->Height - $intYCoordinate2 - $this->intPaddingHeight;
                 } else {
                     $intY = $this->Height + $intYCoordinate1 - 2 - $this->intPaddingHeight;
                 }
                 break;
             case QVerticalAlign::Middle:
                 if ($blnTrueType) {
                     $intY = round(($this->Height - $intBoxHeight) / 2) + $intBoxHeight - $intYCoordinate2;
                 } else {
                     $intY = round(($this->Height - $intBoxHeight) / 2) + $intYCoordinate2;
                 }
                 break;
                 // Step 3 - Use Coordinates
             // Step 3 - Use Coordinates
             default:
                 $intY = $this->intYCoordinate;
                 break;
         }
         $intHeight = $this->Height;
     }
     if ($intWidth <= 0) {
         $intWidth = 100;
     }
     if ($intHeight <= 0) {
         $intHeight = 100;
     }
     $objImage = imagecreate($intWidth, $intHeight);
     // Define Colors
     $intRed = hexdec(substr($this->strBackColor, 0, 2));
     $intGreen = hexdec(substr($this->strBackColor, 2, 2));
     $intBlue = hexdec(substr($this->strBackColor, 4));
     $clrBackground = imagecolorallocate($objImage, $intRed, $intGreen, $intBlue);
     $intRed = hexdec(substr($this->strForeColor, 0, 2));
     $intGreen = hexdec(substr($this->strForeColor, 2, 2));
     $intBlue = hexdec(substr($this->strForeColor, 4));
     $clrForeground = imagecolorallocate($objImage, $intRed, $intGreen, $intBlue);
     if ($this->blnBackgroundTransparent) {
         imagecolortransparent($objImage, $clrBackground);
     }
     imagefilledrectangle($objImage, 0, 0, $intWidth, $intHeight, $clrBackground);
     if ($blnTrueType) {
         imagettftext($objImage, $this->strFontSize, $this->intAngle, $intX, $intY, $clrForeground, $strFontPath, $this->strText);
     } else {
         // Anti Aliasing
         if ($this->blnSmoothFont) {
             $intAntiAliasing = 16;
         } else {
             $intAntiAliasing = 4;
         }
         // Draw Text and Free Font
         imagepstext($objImage, $this->strText, $objFont, $this->strFontSize, $clrForeground, $clrBackground, $intX, $intY, $this->intSpace, $this->intTightness, $this->intAngle, $intAntiAliasing);
         imagepsfreefont($objFont);
     }
     // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
     if (!$strPath) {
         // TODO: Update Cache Parameters
         QApplication::$ProcessOutput = false;
         header('Cache-Control: cache');
         header('Expires: Wed, 20 Mar 2019 05:00:00 GMT');
         header('Pragma: cache');
         switch ($this->strImageType) {
             case QImageType::Gif:
                 header('Content-type: image/gif');
                 imagegif($objImage);
                 break;
             case QImageType::Jpeg:
                 header('Content-type: image/jpeg');
                 imagejpeg($objImage, null, $this->intQuality);
                 break;
             default:
                 header('Content-type: image/png');
                 imagepng($objImage);
                 break;
         }
     } else {
         switch ($this->strImageType) {
             case QImageType::Gif:
                 imagegif($objImage, $strPath);
                 break;
             case QImageType::Jpeg:
                 imagejpeg($objImage, $strPath, $this->intQuality);
                 break;
             default:
                 imagepng($objImage, $strPath);
                 break;
         }
     }
     imagedestroy($objImage);
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:101,代码来源:QImageLabelBase.class.php

示例3: EvaluateTemplate

 /**
  * This function evaluates a template and is used by a variety of controls. It is similar to the function found in the
  * QForm, but recreated here so that the "$this" in the template will be the control, instead of the form,
  * and the protected members of the control are available to draw directly.
  * @param string $strTemplate Path to the HTML template file
  *
  * @return string The evaluated HTML string
  */
 public function EvaluateTemplate($strTemplate)
 {
     global $_ITEM;
     // used by data repeater
     global $_CONTROL;
     global $_FORM;
     if ($strTemplate) {
         QApplication::$ProcessOutput = false;
         // Store the Output Buffer locally
         $strAlreadyRendered = ob_get_contents();
         if ($strAlreadyRendered) {
             ob_clean();
         }
         // Evaluate the new template
         ob_start('__QForm_EvaluateTemplate_ObHandler');
         $strTemplate = $this->GetTemplatePath($strTemplate);
         require $strTemplate;
         $strTemplateEvaluated = ob_get_contents();
         ob_end_clean();
         // Restore the output buffer and return evaluated template
         if ($strAlreadyRendered) {
             print $strAlreadyRendered;
         }
         QApplication::$ProcessOutput = true;
         return $strTemplateEvaluated;
     }
     return null;
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:36,代码来源:QControlBase.class.php

示例4: RenderImageMagickHelper

 /**
  * Used by custom RenderImage method to output the final image.
  * Uses $this->strImageType to determine type of image to be rendered.
  * This version is to be used when rendering an image using the Imagick library.
  * 
  * If strPath is not set, output to the screen.  If it is, save to strPath.
  *
  * @param Imagick $objFinalImage image as an instance of the Imagick class
  * @param string $strPath
  */
 protected function RenderImageMagickHelper($objFinalImage, $strPath)
 {
     // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
     if (!$strPath) {
         $strPath = $this->strImagickTempFilePath . '/image_' . str_replace('.', '_', microtime(true));
         // Output to a temporary location
         switch ($this->strImageType) {
             case QImageType::Gif:
                 $strPath .= '.gif';
                 $objFinalImage->setImageFormat('gif');
                 header('Content-Type: image/gif');
                 break;
             case QImageType::AnimatedGif:
                 $strPath .= '.gif';
                 $objFinalImage->setImageFormat('gif');
                 header('Content-Type: image/gif');
                 break;
             case QImageType::Jpeg:
                 $strPath .= '.jpg';
                 $objFinalImage->setImageFormat('jpeg');
                 $objFinalImage->setCompressionQuality($this->intJpegQuality);
                 header('Content-Type: image/jpeg');
                 break;
             default:
                 $strPath .= '.png';
                 $objFinalImage->setImageFormat('png');
                 header('Content-Type: image/png');
                 break;
         }
         if ($this->strImageType == QImageType::AnimatedGif) {
             file_put_contents($strPath, $objFinalImage->GetImagesBlob());
         } else {
             $objFinalImage->writeImage($strPath);
         }
         QApplication::$ProcessOutput = false;
         header('Cache-Control: cache');
         header('Expires: Wed, 20 Mar 2019 05:00:00 GMT');
         header('Pragma: cache');
         print file_get_contents($strPath);
         unlink($strPath);
     } else {
         // Make Directory
         QApplication::MakeDirectory(dirname($strPath), 0777);
         // Output to Disk
         switch ($this->strImageType) {
             case QImageType::Gif:
                 $objFinalImage->setImageFormat('gif');
                 break;
             case QImageType::AnimatedGif:
                 $objFinalImage->setImageFormat('gif');
                 break;
             case QImageType::Jpeg:
                 $objFinalImage->setImageFormat('jpeg');
                 $objFinalImage->setCompressionQuality($this->intJpegQuality);
                 break;
             default:
                 $objFinalImage->setImageFormat('png');
                 break;
         }
         $objFinalImage->writeImage($strPath);
         chmod($strPath, 0777);
     }
     $objFinalImage->Destroy();
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:74,代码来源:QImageBase.class.php

示例5: SetupContentType

 protected function SetupContentType()
 {
     // TODO: Update Cache Parameters
     QApplication::$ProcessOutput = false;
     header('Cache-Control: cache');
     header('Expires: Wed, 20 Mar 2019 05:00:00 GMT');
     header('Pragma: cache');
     if (!($strImageType = $this->strImageType)) {
         $strImageType = $this->strSourceImageType;
     }
     switch ($strImageType) {
         case QImageType::Jpeg:
         case QImageType::Png:
         case QImageType::Gif:
             header('Content-Type: image/' . $strImageType);
             break;
         default:
             throw new Exception('Invalid Image Type');
     }
 }
开发者ID:vaibhav-kaushal,项目名称:qc-framework,代码行数:20,代码来源:QImageControlBase.class.php


注:本文中的QApplication::ProcessOutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。