public function RenderImage($strPath = null) { $objTextColor = new ImagickPixel('#bbbbbb'); $objBackgroundColor = new ImagickPixel('#393939'); $objBackgroundColorHighlight = new ImagickPixel('#606060'); $objBackgroundColorHighlightLess = new ImagickPixel('#404040'); // Create Objects $this->objImage = new IMagick(); $this->objImage->NewImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, $objBackgroundColor); $this->objDraw = new IMagickDraw(); // Overlay Shade $objNewImage = new IMagick(__DOCROOT__ . '/images/mask.png'); $objNewImage->ResizeImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, IMagick::FILTER_GAUSSIAN, 0.7); $this->objImage->CompositeImage($objNewImage, Imagick::COMPOSITE_MULTIPLY, 0, 0); // $this->objDraw->setStrokeColor($objBackgroundColorHighlight); // $this->DrawHorizontalLine(0, $this->strWidth, 0); // $this->objDraw->setStrokeColor($objBackgroundColorHighlightLess); // $this->DrawHorizontalLine(0, $this->strWidth, 1); $this->objDraw = new IMagickDraw(); $this->objDraw->SetFont($this->Font); $this->SetFontSize($this->FontSize); $this->objDraw->setStrokeColor($objTextColor); $this->objDraw->setFillColor($objTextColor); $this->DrawText($this->Text, $this->XPosition, $this->YPosition); // Scale Down $this->objImage->ResizeImage($this->strWidth, $this->strHeight, Imagick::FILTER_GAUSSIAN, 0.7); return $this->RenderImageMagickHelper($this->objImage, $strPath); }
public function RenderImage($strPath = null) { $objTextColor = new ImagickPixel('#eafaea'); $objTextColorShadow = new ImagickPixel('#163616'); $objBackgroundColor = new ImagickPixel('#5c5c5c'); $this->objImage = new IMagick(); $this->objImage->NewImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, $objBackgroundColor); $this->objDraw = new IMagickDraw(); // Overlay Shade $objNewImage = new IMagick(__DOCROOT__ . '/images/mask.png'); $objNewImage->ResizeImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, IMagick::FILTER_GAUSSIAN, 0.7); $this->objImage->CompositeImage($objNewImage, Imagick::COMPOSITE_MULTIPLY, 0, 0); // Draw Text $this->objDraw->setStrokeColor($objTextColorShadow); $this->objDraw->setFillColor($objTextColorShadow); $this->objDraw->SetFont(__QCODO__ . '/fonts/Formata-Bold.pfb'); $this->SetFontSize(12); $this->DrawText('PHP DEVELOPMENT FRAMEWORK', 159.5, 49.5); $this->objDraw->setStrokeColor($objTextColor); $this->objDraw->setFillColor($objTextColor); $this->DrawText('PHP DEVELOPMENT FRAMEWORK', 158, 48); // Scale Down $this->objImage->ResizeImage($this->strWidth, $this->strHeight, Imagick::FILTER_GAUSSIAN, 0.7); $objLogo = new IMagick(__DOCROOT__ . '/images/qcodo_logo_2.png'); $objLogo->ResizeImage(380 * 0.4, 132 * 0.4, Imagick::FILTER_GAUSSIAN, 0.7); $this->objImage->CompositeImage($objLogo, Imagick::COMPOSITE_OVER, 4, 2); return $this->RenderImageMagickHelper($this->objImage, $strPath); }
public function RenderImage($strPath = null) { switch ($this->Mode) { case NavBarImageMode::Standard: case NavBarImageMode::Hover: // Setup Colors if ($this->Mode == NavBarImageMode::Standard) { $objTextColor = new ImagickPixel('#bbc5bb'); $objBackgroundColor = new ImagickPixel('#5c5c5c'); $objBackgroundColorHighlight = new ImagickPixel('#808080'); $objBackgroundColorHighlightLess = new ImagickPixel('#696969'); } else { $objTextColor = new ImagickPixel('#ffffff'); $objBackgroundColor = new ImagickPixel('#667066'); $objBackgroundColorHighlight = new ImagickPixel('#99a599'); $objBackgroundColorHighlightLess = new ImagickPixel('#778277'); } // Create Objects $this->objImage = new IMagick(); $this->objImage->NewImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, $objBackgroundColor); $this->objDraw = new IMagickDraw(); // Draw Highlights $this->objDraw->setStrokeColor($objBackgroundColorHighlight); $this->DrawHorizontalLine(0, $this->strWidth, 0); $this->DrawVerticalLine(0, 0, $this->strHeight); $this->objDraw->setStrokeColor($objBackgroundColorHighlightLess); $this->DrawHorizontalLine(1, $this->strWidth, 1); $this->DrawVerticalLine(1, 1, $this->strHeight); // Overlay Shade $objNewImage = new IMagick(__DOCROOT__ . '/images/mask.png'); $objNewImage->ResizeImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, IMagick::FILTER_GAUSSIAN, 0.7); $this->objImage->CompositeImage($objNewImage, Imagick::COMPOSITE_MULTIPLY, 0, 0); // Draw Text $this->objDraw->setTextAntiAlias(false); $this->objDraw->setStrokeColor($objTextColor); $this->objDraw->setFillColor($objTextColor); $this->objDraw->SetFont(__QCODO__ . '/fonts/Formata-Medium.pfb'); $this->SetFontSize(14); $this->DrawTextCenterBottom($this->Text, 4); // Scale Down $this->objImage->ResizeImage($this->strWidth, $this->strHeight, Imagick::FILTER_GAUSSIAN, 0.7); break; default: $objBackgroundColor = new ImagickPixel('#335533'); $objBackgroundColorHighlight = new ImagickPixel('#112211'); $objBackgroundColorHighlightLess = new ImagickPixel('#224422'); $objTextColor = new ImagickPixel('#ffffee'); // Create Objects $this->objImage = new IMagick(); $this->objImage->NewImage($this->strWidth * $this->intQuality, $this->strHeight * $this->intQuality, $objBackgroundColor); $this->objDraw = new IMagickDraw(); // Draw Highlights $this->objDraw->setStrokeColor($objBackgroundColorHighlight); // $this->DrawHorizontalLine(0, $this->strWidth, 0); $this->DrawVerticalLine(0, 0, $this->strHeight); $this->objDraw->setStrokeColor($objBackgroundColorHighlightLess); // $this->DrawHorizontalLine(1, $this->strWidth, 1); $this->DrawVerticalLine(1, 0, $this->strHeight); // Draw Text $this->objDraw->setTextAntiAlias(false); $this->objDraw->setStrokeColor($objTextColor); $this->objDraw->setFillColor($objTextColor); $this->objDraw->SetFont(__QCODO__ . '/fonts/Formata-Medium.pfb'); $this->SetFontSize(14); $this->DrawTextCenterBottom($this->Text, 4); // Scale Down $this->objImage->ResizeImage($this->strWidth, $this->strHeight, Imagick::FILTER_GAUSSIAN, 0.7); break; } return $this->RenderImageMagickHelper($this->objImage, $strPath); }