Php-mysql Course

EasyPhpThumbnail class is a Free PHP class for creating thumbnails.
EasyPhpThumbnail allows you to handle image manipulation and generate thumbnails for GIF, JPG and PNG on-the-fly. Resize, crop, rotate, flip, save as, shadow, watermark, text, border, sharpen, blur, water ripple, twirl, mirror reflection, displacement maps, APNG animation.
- EasyPhpThumbnail Class 2.0.5.

Examples:
1. Create a thumbnail with specified width, and height, then save it on the server:
<?php
include('easyphpthumbnail.class.php');

$thumb = new easyphpthumbnail();
$thumb -> Thumblocation = 'thumbs/';           // directory in which to save the thumbnail
$thumb -> Thumbprefix = 'thumb_';              // The prefix for the thumb filename

// Set thumbsize to 100px width, and 70px height
$thumb -> Thumbwidth = 100;
$thumb -> Thumbheight = 70;

// Create the thumbnail and save it
$thumb ->Createthumb('image.jpg', 'file');

/* To output the thumbnail to screen, just delete the seccond parameter, "file" from Createthumb() */
?>
Result:
Thumbnail Image

2. Create thumbnail with same width and height, and rotate de image over 45 degrees:
<?php
include('easyphpthumbnail.class.php');

$thumb = new easyphpthumbnail();
$thumb -> Thumblocation = 'thumbs/';           // directory in which to save the thumbnail
$thumb -> Thumbprefix = 'thumb_';              // The prefix for the thumb filename

// Set thumbsize (same width and height), and rotation 45 degrees
$thumb -> Thumbsize = 125;
$thumb -> Rotate = 45;

// Create the thumbnail and save it
$thumb ->Createthumb('image.jpg', 'file');
?>
Result:
Thumbnail rotation

3. Round two corners for a nice effect:
<?php
include('easyphpthumbnail.class.php');

$thumb = new easyphpthumbnail();
$thumb -> Thumblocation = 'thumbs/';           // directory in which to save the thumbnail
$thumb -> Thumbprefix = 'thumb_';              // The prefix for the thumb filename

$thumb -> Thumbsize = 50;                        // thumb size (percentage 50%)
$thumb -> Percentage = true;                     // enable to use percentage
$thumb -> Backgroundcolor = '#fefe01';           // image background color
$thumb -> Clipcorner = array(2,15,0,1,0,0,1);    // parameters for round corners

// Create the thumbnail and save it
$thumb ->Createthumb('image.jpg', 'file');
?>
Result:
Thumbnail rounded corners

4. A "classic" thumbnail using a shadow, three rounded corners, frame around the photo, and binder:
<?php
include('easyphpthumbnail.class.php');

$thumb = new easyphpthumbnail();
$thumb -> Thumblocation = 'thumbs/';           // directory in which to save the thumbnail
$thumb -> Thumbprefix = 'thumb_';              // The prefix for the thumb filename

$thumb -> Thumbsize = 50;                        // thumb size (percentage 50%)
$thumb -> Percentage = true;                     // enable to use percentage
$thumb -> Backgroundcolor = '#fefefe';           // image background color
$thumb -> Clipcorner = array(2,15,0,1,1,1,0);    // parameters for round corners

$thumb -> Framewidth = 10;                       // frame width, in pixels
$thumb -> Framecolor = '#fefefe';                // frame color

$thumb -> Shadow = true;                         // add a shadow around the thumbnail
$thumb -> Binder = true;                         // draw a binder on the left side of the thumbnail
$thumb -> Binderspacing = 8;                     // space between binder rings in pixels

// Create the thumbnail and save it
$thumb ->Createthumb('image.jpg', 'file');
?>
Result:
Thumbnail with frame and binder

5. Thhumbnail with 2D perspective, two rounded corners, frame around the photo, and binder:
<?php
include('easyphpthumbnail.class.php');

$thumb = new easyphpthumbnail();
$thumb -> Thumblocation = 'thumbs/';           // directory in which to save the thumbnail
$thumb -> Thumbprefix = 'thumb_';              // The prefix for the thumb filename

$thumb -> Thumbsize = 50;                        // thumb size (percentage 50%)
$thumb -> Percentage = true;                     // enable to use percentage
$thumb -> Backgroundcolor = '#fefefe';           // image background color
$thumb -> Clipcorner = array(2,12,0,0,0,1,1);    // parameters for round corners

$thumb -> Framewidth = 10;                       // frame width, in pixels
$thumb -> Framecolor = '#fefefe';                // frame color

$thumb -> Shadow = true;                         // add a shadow around the thumbnail
$thumb -> Binder = true;                         // draw a binder on the left side of the thumbnail
$thumb -> Binderspacing = 8;                     // space between binder rings in pixels

$thumb -> Perspective = array(1,0,25);           // apply a perspective to the image

// Create the thumbnail and save it
$thumb ->Createthumb('image.jpg', 'file');
?>
Result:
Thumbnail with perspective and binder

- In the archive with EasyPhpThumbnail class you'll find more examples, and documentation for API reference in the file "API.txt".
EasyPhpThumbnail Web Site.

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
EasyPhpThumbnail Class

Last accessed pages

  1. Volume and Surface Area Calculator for 3D objects (11272)
  2. PHP Unzipper - Extract Zip, Rar Archives (32246)
  3. Output or Force Download MP3 with PHP (5802)
  4. jQuery background position (5289)
  5. PHP-MySQL free course, online tutorials PHP MySQL code (69463)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (477)
  2. CSS cursor property - Custom Cursors (81)
  3. The Mastery of Love (71)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (64)
  5. CSS3 2D transforms (46)
Chat
Chat or leave a message for the other users
Full screenInchide