PHP Classes

File: docs/create_image.md

Recommend this page to a friend!
  Classes of Chun-Sheng, Li   Selective PHP Image Manipulation   docs/create_image.md   Download  
File: docs/create_image.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: Selective PHP Image Manipulation
Perform several types of image manipulation
Author: By
Last change:
Date: 1 year ago
Size: 751 bytes
 

Contents

Class file image Download

Create Image

Introduction

In this sample, you will learn how to create the image from image data string and file.

The image types that can support jpeg(jpg), png, gif and bmp now.

Create image from image file

$image = new Image();
$imgSrc = $image->getImage('/path/to/image.png');

Create image from image data string

$image = new Image();
$imgSrc = $image->imageFromString('image_data_string');

Create image from bmp file

$image = new Image();
$imgSrc = $image->createImageFromBmp('/path/to/image.bmp');

Destroy the image resource

After manipulating the image file, you should destroy image resource to free the memory.

$image = new Image();
$imgSrc = $image->destroy($imgSrc);