Texturing Aim: How to texture an object
|
|
For our objects to look more realistic we really need to texture them, but what is texture mapping ?
Think if it as a way of adding extra details to an object. For example... You design an ordinary white cube, doesn't look much does it ?
But add a texturemap to it, and suddenly you have a BORG cube !.
Textures are bitmap pictures that have been designed with a paint program (that can save BMP format files.)
Another example... If you designed a basic model of a creature, using a texturemap you could add all the external features - such as clothes and facial expressions.
Although B3D has alot of commands to manage multiple textures and special effects, for now we shall just be using the very basic EntityTexture command.
Of course we could save ourselves alot of time by designing our objects and applying the textures to them directly from a 3d modelling program, but that would make this tutorial a waste of time !.
So why would we want to apply a texture in realtime ?, well for starters a new texture may be put onto the object at any time. Take a wall, shoot it ! - now for things to look realistic in our 3d world, we would like to have somekind of indication that it was shot. We could do this by loading a texture of a bullet hole directly onto the wall. Every 3d game currently on the market uses texture trickery in some form or another, as your experience grows - so will your imagination !. Why have a flat river, when you could use texturemaps to give the impression of ripples or waves.
B3D has so many lovely features for us to use including the new ANIMATED textures command, we will be using this later on !. (Quake I/II/III used this trick to give us the impression of moving water)
Let's look at this in practice:
| Graphics3D 800,600 SetBuffer BackBuffer() camera=CreateCamera() CameraViewport camera,0,0,800,600 light=CreateLight() cube=CreateCube() PositionEntity cube,0,0,5 texture=LoadTexture("blitztexture.bmp") EntityTexture cube,texture While Not KeyHit(1) TurnEntity cube,0.1,0.2,0.3 UpdateWorld RenderWorld Text 340,500,"Texturing Demo" Flip Wend End |
As you can see, a texture can make all the difference to a very basic object.
The only 2 lines of code we don't already know are:
|
texture=LoadTexture("blitztexture.bmp") EntityTexture cube,texture |
Two nice and friendly commands, the first loads a texturemap into memory - with the pointer variable 'texture' pointing to it.
Once we have successfully loaded the texture, we assign it to the object using the EntityTexture command. (here we are assigning the variable pointer TEXTURE to the cube we defined earlier)
You could if you wanted load the picture file BLITZTEXTURE.BMP into MS Paint and make some changes.. if you wanted to !
And that's all there is to it, but a quick word of advice: If your object isn't textured as it should, always check that the texturemaps are in the right directory. It's all to easy to spend half the day trying to work out a texturing problem, only to find that you moved the program to another directory without dragging the associated texture files with it.


|
mlpack
1.0.12
|
The TraversalInfo class holds traversal information which is used in dual-tree (and single-tree) traversals. More...
Public Member Functions | |
| TraversalInfo () | |
| Create the TraversalInfo object and initialize the pointers to NULL. More... | |
| double | LastBaseCase () const |
| Get the base case associated with the last node combination. More... | |
| double & | LastBaseCase () |
| Modify the base case associated with the last node combination. More... | |
| TreeType * | LastQueryNode () const |
| Get the last query node. More... | |
| TreeType *& | LastQueryNode () |
| Modify the last query node. More... | |
| TreeType * | LastReferenceNode () const |
| Get the last reference node. More... | |
| TreeType *& | LastReferenceNode () |
| Modify the last reference node. More... | |
| double | LastScore () const |
| Get the score associated with the last query and reference nodes. More... | |
| double & | LastScore () |
| Modify the score associated with the last query and reference nodes. More... | |
Private Attributes | |
| double | lastBaseCase |
| The last base case. More... | |
| TreeType * | lastQueryNode |
| The last query node. More... | |
| TreeType * | lastReferenceNode |
| The last reference node. More... | |
| double | lastScore |
| The last score. More... | |
The TraversalInfo class holds traversal information which is used in dual-tree (and single-tree) traversals.
A traversal should be updating the members of this class before Score() is called. This class should be held as a member of the RuleType class and the interface to it should be through a TraversalInfo() method.
The information held by this class is the last node combination visited before the current node combination was recursed into, and the score resulting from when Score() was called on that combination. However, this information is identical for a query node and a reference node in a particular node combination, so traversals only need to update the TraversalInfo object in a query node (and the algorithms should only use the TraversalInfo object from a query node).
In general, this auxiliary traversal information is used to try and make a prune without needing to call BaseCase() or calculate the distance between nodes. Using this information you can place bounds on the distance between the two nodes quickly.
If the traversal is not updating the members of this class correctly, a likely result is a null pointer dereference. Dual-tree algorithms should assume that the members are set properly and should not need to check for null pointers.
There is one exception, which is the root node combination; the score can be set to 0 and the query and reference nodes can just be set to the root nodes; no algorithm should be able to prune the root combination anyway.
Definition at line 49 of file traversal_info.hpp.
|
inline |
Create the TraversalInfo object and initialize the pointers to NULL.
Definition at line 55 of file traversal_info.hpp.
|
inline |
Get the base case associated with the last node combination.
Definition at line 77 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastBaseCase.
|
inline |
Modify the base case associated with the last node combination.
Definition at line 79 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastBaseCase.
|
inline |
Get the last query node.
Definition at line 62 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastQueryNode.
|
inline |
Modify the last query node.
Definition at line 64 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastQueryNode.
|
inline |
Get the last reference node.
Definition at line 67 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastReferenceNode.
|
inline |
Modify the last reference node.
Definition at line 69 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastReferenceNode.
|
inline |
Get the score associated with the last query and reference nodes.
Definition at line 72 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastScore.
|
inline |
Modify the score associated with the last query and reference nodes.
Definition at line 74 of file traversal_info.hpp.
References TraversalInfo< TreeType >::lastScore.
|
private |
The last base case.
Definition at line 89 of file traversal_info.hpp.
Referenced by TraversalInfo< TreeType >::LastBaseCase().
|
private |
The last query node.
Definition at line 83 of file traversal_info.hpp.
Referenced by TraversalInfo< TreeType >::LastQueryNode().
|
private |
The last reference node.
Definition at line 85 of file traversal_info.hpp.
Referenced by TraversalInfo< TreeType >::LastReferenceNode().
|
private |
The last score.
Definition at line 87 of file traversal_info.hpp.
Referenced by TraversalInfo< TreeType >::LastScore().


Indexing to come real soon, please be patient.
The People
The following people are interested in employment within
the World Wide Web and offer themselves for work:
George Philippakos
His resume
Justin Couch
Resume
Kevin Rattai
Resume
Howard Ting-hao Yen
Resume
John C. von Rosen
Thomas Finneid
Resume
Wayne Seward
James Dueck
Information
David Richard
His home pages
Ron Verbrugge
Mik Clarke
His pages and resume
Claudia Lynn Pearson
VRML School of Business at UAA
Sandeep Sopori and his heavy
gfx pages
Hal Eagar
His pages
Joel Tanis
Back to the office.
Mail me if you would like to be added to this list:
<EMAIL_ADDRESS>(Kevin Rattai).
Warning:


{% extends "base.html" %} {% block pagetitle %}About the Astro-ph Coffee Server{% end %} {% block pageheader %} {% include "topbar.html" %}
astroph-coffee is a small platform to view and vote on arXiv astro-ph papers, and helps to organize paper discussions. It's a bit like VoxCharta, but much simpler, and can be fully installed on a local department server.
The server's code is hosted on Github, and it's meant to be simple to install and use. Please let Waqas Bhatti know if something doesn't look right, or is completely broken, or if you have questions. The email address to use is:
wbhatti -at- astro -dot- princeton -dot- edu
astroph-coffee uses the following open-source libraries:
This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.
The astro-ph article listings are generated from the arXiv e-print server.


In New York, like in lots of cities, you can call 3-1-1 for help with city services, but also for all kinds of other stuff. The most common calls they get are about landlords not heating apartments properly. But they'll also help you get hold of a W-2 form you need from 2009.
Actually, I had a call today.
This is 311 operator Victoria Dusini.
The woman said that her fiance died in their bed, and she was pregnant, and she wanted to identify his DNA in order to get social security benefits. So she wanted to know who to contact.
Well, a woman was cleaning her garage and she moved a box, and there was a crocodile. So I had to ask her, like a crocodile, like, big, with-- she's like, yeah, it's going snap, snap at me.
She says that was an easy one, of course-- call Animal Care and Control. But she also helped with this call.


"Trump, who says a lot of things about the election here that even his own administration has rejected, acknowledges Biden won for the first time," wrote Kaitlan Collins, CNN's White House correspondent.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
Millions of Americans prepare to celebrate the national holiday next week with conflicting advice over whether to mark the day with traditional gatherings.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
Robert O'Brien, a Trump loyalist, said that it "obviously" looks like "the Biden-Harris ticket [will be] determined to be the winner" and that the National Security Council will support a smooth transition like it has "even in the most contentious periods" in history.
The number of mass shootings in the U.S. have soared in 2020, despite widespread closures of schools, officers and many public places due to the pandemic.
With over 15,000 business schools worldwide, it is increasingly difficult for prospective students, executives, corporate partners and other stakeholders to recognize a quality institution. That’s where an EQUIS Accreditation comes in. Find out more.
Dr. Amesh Adalja of Johns Hopkins University said that public health agencies should be treated like "national security personnel because this is a national security crisis."
Meet the toymakers and brands who are lending a helping hand to science, technology, engineering and math (STEM) education
Introducing Newsweek's first ranking of the financial institutions that best serve their customers' needs in today's challenging times.
In the first part of this special, we rank the best hospitals in cardiology, oncology and endocrinology.
What does it take to be a leader in Global Education? What sets the best Universities apart from the others on the world stage? Find out more..
Meet the toymakers and brands who are lending a helping hand to science, technology, engineering and math (STEM) education.
The number of mass shootings in the U.S. have soared in 2020, despite widespread closures of schools, officers and many public places due to the pandemic.
Meet the toymakers and brands who are lending a helping hand to science, technology, engineering and math (STEM) education
Introducing Newsweek's first ranking of the financial institutions that best serve their customers' needs in today's challenging times.
In the first part of this special, we rank the best hospitals in cardiology, oncology and endocrinology.
Dr. Amesh Adalja of Johns Hopkins University said that public health agencies should be treated like "national security personnel because this is a national security crisis."
Dr. Amesh Adalja of Johns Hopkins University said that public health agencies should be treated like "national security personnel because this is a national security crisis."
Dr. Amesh Adalja of Johns Hopkins University said that public health agencies should be treated like "national security personnel because this is a national security crisis."
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The president has thus far refused to acknowledge his defeat, leaning on baseless conspiracy theories and longshot litigation to dispute the result.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.
The balance of power in the Senate—and level of effectiveness of Joe Biden's incoming administration—hangs in the balance with dual Senate runoffs in Georgia, and Black and Latino groups are mobilizing to try to win two seats in an incredibly challenging political environment.


The package SpiceRoot contains basic records and functions that are needed in SPICE3.
| Name | Description |
|---|---|
| SpiceRoot | Data for insertion to matrices |
| useInitialConditions | Initial condition handling |
| initJunctionVoltages | Choice of junction voltage handling, obsolete, use initJunctionVoltagesRevised |
| limitJunctionVoltage | Limitation of junction voltage, obsolete, use limitJunctionVoltageRevised |
| limitJunctionVoltageRevised | Limitation of junction voltage |
| initJunctionVoltagesRevised | Choice of junction voltage handling |


{% if indicator.has_cybox_repr %} {% with type="Indicator" item=indicator %} {% include "taxii_service_master_tab.html" %} {% endwith %} {% else %}
CRITs currently has no way to convert this item to standards. This means one of two things:


Help
Drag to orbit
Shift-Drag to pan
Scroll to zoom
Click to add a voxel
Right click to remove a voxel


SKYNET
Add Room
Add Fast Reservation
Hotel's Profile
My Profile
Reports
Visits Report
Income Report
Log out
About
Rooms
Fast Reservations
Hotel's offers
Make your search easier!
Choose what will your room offer:
×
Name:
Address:
Description:
×
Image:
×
Name of hotel offer:
Price of hotel offer:
Hotel offer description:
×
Name of hotel offer:
Price of hotel offer:
Hotel offer description:


REVIEW FORM
What are your thoughts on the app????
What upgradation do you think is necessary??
Your ratings to the app
GOOD
AWESOME
POOR
VERY GOOD


A "Indent capable" Emmet.
Emmet is written as one line. It is a little complecated. And I found that it is more simple and more visibility that expand Emmet code as multi line and use indent instead of ">" or "+" or "^".
See https://github.com/hwakimoto/lemmet for more information.
Copy your Lemmet code from your text editor and paste to Lemmet field and push "Convert to Emmet" button. Then you can get Emmet code.
Source code: https://github.com/hwakimoto/lemmet
Copyright: ©2018 Hiroyuki Wakimoto
License: MIT
Contact(Mastodon): @tomoki@vocalodon.net


In 1986, Sega released the "Sega Master System" in the West to underwhelming reception. Nintendo had an iron grip on the video game industry with the NES on the market, and it was hard for any company to gain any kind of ground unless they went into a licensing deal with Nintendo.
In 1989, however, two years before Nintendo would release their 16-bit console, the Super Nintendo, Sega released the console that would put them on the map--the Sega Genesis.
The advertising campaigns were brutal in their attempt to defame Nintendo and the legacy they built. The graphics of games such as Altered Beast blew people away. Before the Genesis, they could only see visuals like that on an arcade cabinet!
By the time the Super Nintendo was released to the public in holiday 1991, the Sega Genesis had already won over the hearts of many gamers. For the majority of the early 90s, both Nintendo and Sega battled for the title of the top video game company in the West.
Generally, the Super Nintendo is considered more technologically advanced than the Genesis. However, there are aspects of the Genesis that were superior, and which Sega eagerly capitalized off of. These include:
- Faster CPU (~2.68MHz vs 7.67MHz) (This is the 'Blast Processing' Sega used in their marketing to fight Nintendo!)
- The console had a built-in synthesizer, giving Genesis games a distinctly metal and "bass-y" soundtrack
- The physical console itself looked more "sleek" to Western audiences (to some, the Super Nintendo looked like a child's toy)
- The Genesis was priced cheaper than the Super Nintendo while both consoles were on the market


ARC's Out
29 January 2008
We're releasing a version of Arc today, along with a site about it at arclanguage.org. This site will seem very familiar to users of Hacker News. It's mostly the same code, with a few colors and messages changed.
...
Arc is a new dialect of Lisp we're working on. You can find an early release and ask questions at arclanguage.org. The Arc community is very newbie-friendly, because all the users are newbies to some extent.
Useful links:
We're releasing a version of Arc today, along with a site about it at arclanguage.org. This site will seem very familiar to users of Hacker News. It's mostly the same code, with a few colors and messages changed.
...
Arc's been out for a few days now. Everyone seems to have an opinion about it. The low end are much the same as the low end of opinions about anything online. There's no high end yet, because no one has had enough time yet to be able to speak from experience about what it's like to program in Arc. Those are the responses I'm really interested in. But in the meantime, we have the medium-level responses: the opinions of people who have some understanding of the issues involved, but who are writing based on first impressions.
...
My first priority with Arc right now is the core language—those operators that are neither primitives like car and cdr, nor special-purpose library functions. I mean operators like CL's mapcar, let, remove-if-not, and so on.
...
We often get mail saying: you should take a look at Language X; it has some really cool features.
We're ready to embrace (and extend) any great new ideas that are out there, but there are just too many languages for us to learn them all.
...
We've been criticized for designing Arc as a language for good programmers. Good design, the argument goes, means understanding the needs of your users, and most programmers are not good programmers.
...
There is a kind of mania for object-oriented programming at the moment, but some of the smartest programmers I know are some of the least excited about it.
...
(This is from an email sent by Mike Vanier. It is such a well-written description of the problems hackers face that I thought everyone should see it.)
...


{% extends 'layout.html'%} {% block body %}
The Web-interface provide links to access different tools for analysing sketch maps.


Next: dynamic-extent, Previous: declare, Up: Evaluation and Compilation Dictionary
(ignore {var | (function fn)}*)
(ignorable {var | (function fn)}*)
var—a variable name.
fn—a function name.
declaration
variable, function
The ignore and ignorable declarations refer to for-value references to variable bindings for the vars and to function bindings for the fns.
An ignore declaration specifies that for-value references to the indicated bindings will not occur within the scope of the declaration. Within the scope of such a declaration, it is desirable for a compiler to issue a warning about the presence of either a for-value reference to any var or fn, or a special declaration for any var.
An ignorable declaration specifies that for-value references to the indicated bindings might or might not occur within the scope of the declaration. Within the scope of such a declaration, it is not desirable for a compiler to issue a warning about the presence or absence of either a for-value reference to any var or fn, or a special declaration for any var.
When not within the scope of a ignore or ignorable declaration, it is desirable for a compiler to issue a warning about any var for which there is neither a for-value reference nor a special declaration, or about any fn for which there is no for-value reference.
Any warning about a "used" or "unused" binding must be of type style-warning, and may not affect program semantics.
The stream variables established by with-open-file, with-open-stream, with-input-from-string, and with-output-to-string, and all iteration variables are, by definition, always "used". Using (declare (ignore v)), for such a variable v has unspecified consequences.
Next: dynamic-extent, Previous: declare, Up: Evaluation and Compilation Dictionary


In my last Node.js post I created a simple website for my projects, creating static pages is a breeze once you understand how Express works. However, your traditional website is not really complete without a 'contact us' page, today I will write about creating a contact form for my website.
Node.js is minimalistic by design and does not offer native support for sending emails, for this purpose I have chosen Nodemailer - an easy to use module to send e-mails with Node.JS.
A new view is required to display our contact page therefore I created a file in the views directory and named it contact.jade
.
h1 Contact Form
div.content
form(action='/contact', name='contactus', id='contactus', method='post')
fieldset
p
label(for='name') Name:
br
input(name='name', type='text', value='', id='name')
p
label(for='email') Email:
br
input(name='email', type='text', value='', id='email')
p
label(for='message') Message:
br
textarea(name='message', cols='40', rows='10', id='message')
p
input(name='submit', type='submit', value='Send', id='submit')
After the form view is created we need to create a route that will handle a /contact
GET request and load the view. Two files need to be edited, app.js and routes/index.js
.
app.get('/contact', routes.contact);
exports.contact = function(req, res){
res.render('contact', { title: 'Raging Flame Laboratory - Contact', page: 'contact' })
};
At this point our contact page is working beautifully but cannot do much because it can't handle any data.
I really love express for its ease to use and the amount of goodness it comes with, in our app.js
file we need to include the bodyParser()
middleware, this will ensure that form variables are stored in the request object.
Next we need to install Nodemailer.
npm install nodemailer
Let us edit app.js and include this module.
var nodemailer = require('nodemailer');
Nodemailer has several options for sending emails, you can find out more on the github page, I chose to use the Gmail option. Let's handle the /contact
post request:
app.post('/contact', function (req, res) {
var mailOpts, smtpTrans;
//Setup Nodemailer transport, I chose gmail. Create an application-specific password to avoid problems.
smtpTrans = nodemailer.createTransport('SMTP', {
service: 'Gmail',
auth: {
user<EMAIL_ADDRESS>pass: "application-specific-password"
}
});
//Mail options
mailOpts = {
from: req.body.name + ' <' + req.body.email + '>', //grab form data from the request body object
to<EMAIL_ADDRESS>subject: 'Website contact form',
text: req.body.message
};
smtpTrans.sendMail(mailOpts, function (error, response) {
//Email not sent
if (error) {
res.render('contact', { title: 'Raging Flame Laboratory - Contact', msg: 'Error occured, message not sent.', err: true, page: 'contact' })
}
//Yay!! Email sent
else {
res.render('contact', { title: 'Raging Flame Laboratory - Contact', msg: 'Message sent! Thank you.', err: false, page: 'contact' })
}
});
});
I had problems initially connecting to Gmail because my Gmail account uses a 2-factor authentication but that was easy to solve, simply create an application-specific password.
Lastly, we need to give some kind of feedback to the user.
if(typeof msg !== 'undefined')
if(!!err)
div(class='msgbox err') #{msg}
else
div(class='msgbox success') #{msg}
That's all folks, my contact page is now fully functional. Please add basic sanitization and form validation if you are going to create a similar form.


Support EasyPhpThumbnail by booking your next hotel through the link below:
Getting started: 1. Download EasyPhpThumbnail and upload the example directory to your webserver 2. Upload the class (PHP4 or PHP5 version) to the 'inc' example directory 3. Open the example.php page in your browser This will display a resized thumbnail. You can edit the example.php file and try one of the many examples. The most simple example script would be: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Createthumb('gfx/image.jpg'); ?> This would create a thumbnail with the standard settings and send the result to the browser (dynamic or on-the-fly thumbnail generation). If you want to integrate the thumbnail on a webpage, you have to use a dynamic image. Create a separate PHP file called for example 'thumbnail.php' and add your code there: <?php if (isset($_REQUEST['thumb'])) { include_once('inc/easyphpthumbnail.class.php'); // Your full path to the images $dir = str_replace(chr(92),chr(47),getcwd()) . '/gfx/'; // Create the thumbnail $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Createthumb($dir . basename($_REQUEST['thumb'])); } ?> Then on your page where you need the thumbnail add a link to the image like (save this sample as photo.php): <?php $file='image.jpg'; echo "<img src=\"thumbnail.php?thumb=$file\" alt=\"thumb\" />"; ?> The directory structure in the above example would be: inc which includes the class, gfx for the images (needs to contain a file called 'image.jpg') and the files photo.php and thumbnail.php. Open the file 'photo.php' in your browser to see the result.The example above would show a larger thumbnail by using the 'Thumbsize' parameter: Writing the thumbnail to file: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Createthumb('gfx/image.jpg','file'); ?> For batch creation of thumbnails you can pass an array with filenames: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Createthumb(array('gfx/image.jpg','image2.jpg','image3.jpg'),'file'); ?> Alternatively you can pass filename by filename allowing you to customize some options per image. In the example script below every image in the working directory is converted to JPG format and saved in the subdirectory 'gfx/thumbs/'. In addition the thumbnail files are renamed with prefix '120px_thumb_' and chmod-ded to '0755'. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 120; $thumb -> Chmodlevel = '0755'; $thumb -> Thumblocation = 'gfx/thumbs/'; $thumb -> Thumbsaveas = 'jpg'; $thumb -> Thumbprefix = '120px_thumb_'; if ($dir=@opendir('./')) { while ($filename=@readdir($dir)) { if (($filename!='.') && ($filename!='..') && !is_dir($filename)) { $extension=strtolower(substr($filename,strrpos($filename,'.')+1,strlen($filename))); if ($extension=='jpg' || $extension=='jpeg' || $extension=='png' || $extension=='gif') { // Output to file // You can add some custom changes for individual images here $thumb -> Createthumb($filename,'file'); } } } } ?> Now let's add some more options: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 50; $thumb -> Percentage = true; $thumb -> Createthumb('gfx/image.jpg'); ?> The standard resizing option is based in pixels, enable the percentage as in the example above and the thumbnail will be resized to 50%. The Thumbsize parameter resizes automatically based on width for landscape images and height for portrait images. In the example below we rotate the image by 90 degrees to obtain a portrait image, which is resized by 50%. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 50; $thumb -> Rotate = 90; $thumb -> Percentage = true; $thumb -> Createthumb('gfx/image.jpg'); ?> The example below adds a shadow to the thumbnail, the background color is matched with the page background color. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Shadow = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Round the corners for a nice effect. The Clip corners function is an array with 7 values; [0]: 0=disable 1=straight 2=rounded [1]: Percentage of clipping [2]: Clip randomly - Boolean 0=disable 1=enable [3]: Clip top left - Boolean 0=disable 1=enable [4]: Clip bottom left - Boolean 0=disable 1=enable [5]: Clip top right - Boolean 0=disable 1=enable [6]: Clip bottom right - Boolean 0=disable 1=enable <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Clipcorner = array(2,15,0,0,1,1,0); $thumb -> Createthumb('gfx/image.jpg'); ?> You can also round the corners and make them transparent: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Backgroundcolor = '#0000FF'; $thumb -> Clipcorner = array(2,15,0,1,1,1,1); $thumb -> Maketransparent = array(1,1,'#0000FF',30); $thumb -> Createthumb('gfx/image.jpg'); ?> You can add a frame to create a more realistic photo effect: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Framewidth = 10; $thumb -> Framecolor = '#FFFFFF'; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Shadow = true; $thumb -> Createthumb('gfx/image.jpg'); ?> The next example will show a more 'classic' thumbnail using a shadow and frame around the photo and the binder functionality. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Framewidth = 10; $thumb -> Framecolor = '#FFFFFF'; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Shadow = true; $thumb -> Binder = true; $thumb -> Binderspacing = 8; $thumb -> Clipcorner = array(2,15,0,1,1,1,0); $thumb -> Createthumb('gfx/image.jpg'); ?> Of course it is also possible to watermark your images. The position is determined by providing the XY position in a % of width and height. The position '0% 0%' would be top-left, '100% 100%' will be bottom right. The transparency of the PNG image can be set between 0 and 100. You get the best effect with transparent PNG images as shown in the example below: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Framewidth = 10; $thumb -> Framecolor = '#00000'; $thumb -> Backgroundcolor = '#000000'; $thumb -> Clipcorner = array(2,15,0,1,1,1,1); $thumb -> Watermarkpng = 'watermark.png'; $thumb -> Watermarkposition = '50% 50%'; $thumb -> Watermarktransparency = 70; $thumb -> Createthumb('gfx/image.jpg'); ?> Another option to protect your copyright is to write a short text on the image. The following example uses the systemfont. The textcolor, black or white, is automatically determined based on the color of the background of the image. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Copyrighttext = 'MYWEBMYMAIL.COM'; $thumb -> Copyrightposition = '0% 95%'; $thumb -> Createthumb('gfx/image.jpg'); ?> For a nicer effect you can use a TTF font: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Copyrighttext = 'MYWEBMYMAIL.COM'; $thumb -> Copyrightposition = '50% 90%'; $thumb -> Copyrightfonttype = 'handwriting.ttf'; $thumb -> Copyrightfontsize = 30; $thumb -> Copyrighttextcolor = '#FFFFFF'; $thumb -> Createthumb('gfx/image.jpg'); ?> Adding a border to the image creates very interesting effects. In the following example a transparent PNG image with blue border and white inner-frame was used. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Framewidth = 10; $thumb -> Framecolor = '#00000'; $thumb -> Borderpng = 'border.png'; $thumb -> Copyrighttext = 'MYWEBMYMAIL.COM'; $thumb -> Copyrightposition = '50% 80%'; $thumb -> Copyrightfonttype = 'handwriting.ttf'; $thumb -> Copyrightfontsize = 30; $thumb -> Copyrighttextcolor = '#FFFFFF'; $thumb -> Createthumb('gfx/image.jpg'); ?> Another border example: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Borderpng = 'cloud.png'; $thumb -> Createthumb('gfx/image.jpg'); ?> You can crop the image from the sides or from the center. The crop function is an array with 6 values; [0]: 0=disable 1=enable free crop 2=enable center crop [1]: 0=percentage 1=pixels [2]: Crop left [3]: Crop right [4]: Crop top [5]: Crop bottom <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Cropimage = array(2,0,20,20,35,35); $thumb -> Createthumb('gfx/image.jpg'); ?> You can convert the image to greyscal or age it using the aging function which is an array with 3 values; [0]: Boolean 0=disable 1=enable [1]: Add noise 0-100, 0=disable [2]: Sephia depth 0-100, 0=disable (=greyscale) By adding 'noise' to the image it will look less sharp, the sephia turns it into old darkbrownish colors. <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Shadow = true; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Cropimage = array(2,0,20,20,35,35); $thumb -> Ageimage = array(1,10,80); $thumb -> Createthumb('gfx/image.jpg'); ?> You can rotate or flip the image. The following example flips the image over the horizontal axis: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Fliphorizontal = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Flipping over the vertical axis: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Flipvertical = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Rotate at any angle without cropping the image, the example below rotates the image over -75 degrees: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Rotate = -75; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Createthumb('gfx/image.jpg'); ?> The 'Square' function will create a square canvas (same width and height - for demonstration the background/canvas is red): <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Backgroundcolor = '#FF0000'; $thumb -> Cropimage = array(2,0,20,20,35,35); $thumb -> Ageimage = array(1,0,0); $thumb -> Rotate = 180; $thumb -> Square = true; $thumb -> Createthumb('gfx/image.jpg'); ?> You can combine all the above image manipulations, the class will determine the correct order in which to apply them. Setting the 'Quality' will improve the output result of JPG images: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Backgroundcolor = '#0000FF'; $thumb -> Clipcorner = array(2,15,0,1,1,1,1); $thumb -> Quality = 100; $thumb -> Rotate = -35; $thumb -> Square = true; $thumb -> Createthumb('gfx/image.jpg'); ?> You can also apply image manipulations without resizing the original image by setting the 'Thumbsize' parameter to zero, as shown below: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 0; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Clipcorner = array(2,5,0,1,1,1,1); $thumb -> Watermarkpng = 'watermark.png'; $thumb -> Watermarkposition = '0% 100%'; $thumb -> Watermarktransparency = 50; $thumb -> Copyrighttext = 'Copyright (c)'; $thumb -> Copyrightposition = '100% 90%'; $thumb -> Copyrightfonttype = 'handwriting.ttf'; $thumb -> Copyrightfontsize = 30; $thumb -> Copyrighttextcolor = '#D0DEEE'; $thumb -> Createthumb('gfx/image.jpg'); ?> New functionality added in version 1.0.2: User defined filters for PHP4 and PHP5 similar to Paint Shop Pro. A 3x3 filter matrix is applied to the image. The class includes standard filters for sharpening, blurring, embossing and edge detection: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Edge = true; $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Emboss = true; $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Sharpen = true; $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Blur = true; $thumb -> Createthumb('gfx/image.jpg'); ?> It is also possible to define your own filter and set the divisor and offset parameters: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Filter = array(-1,-1,-1,-1,8,-1,-1,-1,-1); $thumb -> Divisor = 1; $thumb -> Offset = 0; $thumb -> Applyfilter = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Another function added in version 1.0.2 is the standard rotate() function that rotates and crops the image to fit the canvas: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Rotate = -30; $thumb -> Croprotate = true; $thumb -> Createthumb('gfx/image.jpg'); ?> New functionality added in version 2.0.0: Perspective allows you to create a 2D perspective from the left, right, top or bottom side to the image or thumbnail: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Perspective = array(1,0,20); $thumb -> Createthumb('gfx/image.jpg'); ?> By using the shading function a shadow gradient can be applied from the left, right, top or bottom side to the image: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Shading = array(1,70,80,0); $thumb -> Shadingcolor = '#D0DEEE'; $thumb -> Createthumb('gfx/image.jpg'); ?> The mirror effect mirrors a part of the image and uses a gradient for enhanced effect. It is possible to set a reflection gap between the image and reflection: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Mirror = array(1,10,70,40,2); $thumb -> Mirrorcolor = '#D0DEEE'; $thumb -> Createthumb('gfx/image.jpg'); ?> The negative and grayscale function create true color results: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Greyscale = true; //$thumb -> Negative = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Replace colors with the colorreplace function and define a tolerance/sensitivity: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Colorreplace = array(1,'#FFFFFF','#FF6600',60); $thumb -> Createthumb('gfx/image.jpg'); ?> Define a transparent color with tolerance/sensitivity (8-bit GIF or PNG): <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Maketransparent = array(1,0,'#171915',30); $thumb -> Createthumb('gfx/image.jpg'); ?> Repositioning pixels randomly creates interesting effects: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Pixelscramble = array(1,4,2); $thumb -> Createthumb('gfx/image.jpg'); ?> Brightness, contrast and gamma can also be modified: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Brightness = array(1,50); //$thumb -> Contrast = array(1,30); //$thumb -> Gamma = array(1,0.5); $thumb -> Createthumb('gfx/image.jpg'); ?> It is possible to merge/blend a color or reduce the colors in the palette: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Colorize = array(1,0,0,125,0); //$thumb -> Palette = array(1,64); $thumb -> Createthumb('gfx/image.jpg'); ?> Noise in images can be reduced by a mean filter, this generally blurs the image: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Mean = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Another method to reduce noise is with a median filter, which provides excellent results in filtering 'dead' pixels: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Medianfilter = true; $thumb -> Createthumb('gfx/image.jpg'); ?> Below follow some interesting image deformation filters starting with a simple pixelate filter and ending with mathematical bilineair deformations: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Pixelate = array(1,10); $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Ripplefx = array(1,5,15,5,5); $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Twirlfx = array(1,20,0); $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Lakefx = array(1,15,80); $thumb -> Createthumb('gfx/image.jpg'); ?> <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Waterdropfx = array(1,1.2,400,40); $thumb -> Createthumb('gfx/image.jpg'); ?> New functionality added in version 2.0.1: The function Cropimage() now includes a square scrop, see example below: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 200; $thumb -> Cropimage = array(3,0,0,0,0,0); $thumb -> Createthumb('gfx/image.jpg'); ?> New functionality added in version 2.0.3: The function Create_apng() creates an animated PNG image, see example below (PNG animation is only supported by Mozilla Firefox 3, Opera 9.5, KSquirrel 0.7.2 and XnView 1.92 for the moment, other browsers will display the 1st frame only): <?php // First we create some new PNG thumbnails // Then we create the animation set_time_limit(0); $frames = array(); $thumb -> Thumbsaveas = 'png'; $thumb -> Thumbprefix = ''; $thumb -> Thumblocation = ''; $thumb -> Copyrighttext = 'MYWEBMYMAIL.COM'; $thumb -> Copyrightfonttype = 'gfx/handwriting.ttf'; $thumb -> Copyrighttextcolor = '#FFFFFF'; for ($i = 1; $i <= 8; $i++) { $frames[] = "frame$i.png"; $thumb -> Thumbfilename = "frame$i.png"; $thumb -> Copyrightposition = '50% 50%'; $thumb -> Copyrightfontsize = $i*4; // You can also add the waterdrop effect, but it might time out! // $thumb -> Waterdropfx = array(1,$i/6,400,40); $thumb -> Createthumb('gfx/image.jpg','file'); } // Create the animation $thumb -> Create_apng($frames, 'animation.png', 250); ?> New functionality added in version 2.0.4: The Polaroid and displacement map feature, previously only available in the Pro version are now included in the free version: <?php include_once('easyphpthumbnailpro.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Shadow = true; $thumb -> Polaroid = true; $thumb -> Polaroidtext = 'MYWEBMYMAIL.COM'; $thumb -> Polaroidfonttype = 'handwriting.ttf'; $thumb -> Polaroidfontsize = '30'; $thumb -> Polaroidtextcolor = '#000000'; $thumb -> Createthumb('gfx/image.jpg'); ?> Image deformation is also possible by using a displacement map and bilinear filter. The Red and Green colors of the image in the displacement map are a measure for the X and Y pixel shift in the original image, grey is neutral. You can spend hours discovering effects of displacement maps: <?php include_once('easyphpthumbnailpro.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Displacementmap = array(1,'gfx/displacementmap.jpg',0,0,0,50,50); $thumb -> Createthumb('gfx/image.jpg'); ?> A displacement map can be applied to the image and a 2nd map to the thumbnail creating stunning effects: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 300; $thumb -> Copyrighttext = 'MYWEBMYMAIL.COM'; $thumb -> Copyrightposition = '50% 80%'; $thumb -> Copyrightfonttype = 'gfx/handwriting.ttf'; $thumb -> Copyrightfontsize = 20; $thumb -> Copyrighttextcolor = '#FFFFFF'; $thumb -> Borderpng = 'gfx/border.png'; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Mirror = array(1,30,90,40,2); $thumb -> Mirrorcolor = '#D0DEEE'; $thumb -> Displacementmap = array(1,'gfx/displacementmap_ball.jpg',0,0,0,50,50); $thumb -> Displacementmapthumb = array(1,'gfx/displacementmap.jpg',0,0,200,25,25); $thumb -> Createthumb('gfx/image.jpg'); ?> By using the Canvas option it is possible to create an image without loading it from file and apply some effects like a text wobble: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Createcanvas(300,50,IMAGETYPE_PNG,'#D0DEEE',false); $thumb -> Addtext = array(1,'MYWEBMYMAIL.COM','50% 50%','gfx/handwriting.ttf',20,'#FF0000'); $thumb -> Ripplefx = array(1,3,12,0,0); $thumb -> Framewidth = 10; $thumb -> Framecolor = '#FF6600'; $thumb -> Backgroundcolor = '#D0DEEE'; $thumb -> Shadow = true; $thumb -> Createthumb(); ?> In order to load pages faster you can embed images in HTML or email messages, called base64 encoded image data: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; echo '<img src="' . $thumb -> Createbase64('gfx/image.jpg') . '" />'; ?> By using the option 'Keeptransparency' you can resize images with transparency: <?php include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Thumbsize = 100; $thumb -> Keeptransparency = true; $thumb -> Createthumb('gfx/cloud.png'); ?> Changes in version 2.0.5:
API reference: Initialize the class: Initialize the class and output a thumbnail to the screen: include_once('inc/easyphpthumbnail.class.php'); $thumb = new easyphpthumbnail; $thumb -> Createthumb('gfx/image.jpg'); Over 60+ Options, in alphabetical order: A $thumb -> Addtext = array() // Add text to the original image Array with 6 values [0]: 0=disable 1=enable [1]: The text to add [2]: The position of the text '50% 50%' is the center [3]: Path to the TTF font (standard systemfont will be used) [4]: The fontsize to use [5]: The copyright text color in web format '#000000' $thumb -> Ageimage = (array) // Apply greyscale array(1,0,0) or aging effect array(1,10,80) Age image; array with 3 values [0]: Boolean 0=disable 1=enable [1]: Add noise 0-100, 0=disable [2]: Sephia depth 0-100, 0=disable (greyscale) $thumb -> Applyfilter = (boolean) // Apply a user defined 3x3 filter B $thumb -> Backgroundcolor = (string) // The backgroundcolor in web format '#FFFFFF' $thumb -> Binder = (boolean) // Draw a binder on the left side of the thumbnail $thumb -> Binderspacing = (int) // Space between binder rings in pixels $thumb -> Blur = (boolean) // Auto-filter: Blur $thumb -> Borderpng = (string) // The path to the thumbnail border PNG image $thumb -> Brightness = (array) // Change the brightness of the image array(1,50) Array with 2 values [0]: Boolean 0=disable 1=enable [1]: Brightness -100 to 100 C $thumb -> Chmodlevel = (string) // The chmod command to apply to saved thumbnails '0755' $thumb -> Clipcorner = (array) // Clip the corners of the thumbnail array(2,15,0,1,1,1,0) Clip corners; array with 7 values [0]: 0=disable 1=straight 2=rounded [1]: Percentage of clipping [2]: Clip randomly Boolean 0=disable 1=enable [3]: Clip top left Boolean 0=disable 1=enable [4]: Clip bottom left Boolean 0=disable 1=enable [5]: Clip top right Boolean 0=disable 1=enable [6]: Clip bottom right Boolean 0=disable 1=enable $thumb -> Colorreplace = (array) // Replace a color in the image array(1,'#FFFFFF','#FF6600',60) Array with 4 values [0]: Boolean 0=disable 1=enable [1]: Color to replace in web format: '#00FF00' [2]: Replacement color in web format: '#FF0000' [3]: RGB tolerance 0 - 100 $thumb -> Colorize = (array) // Merge a color in the image array(1,0,0,125,0) Array with 5 values [0]: Boolean 0=disable 1=enable [1]: Red component 0 - 255 [2]: Green component 0 - 255 [3]: Blue component 0 - 255 [4]: Opacity level 0 - 127 $thumb -> Contrast = (array) // Change the contrast of the image array(1,30) Array with 2 values [0]: Boolean 0=disable 1=enable [1]: Contrast -100 to 100 $thumb -> Copyrighttext = (string) // Copyright text $thumb -> Copyrightposition = (string) // The position of the text '50% 50%' is the center $thumb -> Copyrightfonttype = (string) // The path to the TTF font (standard systemfont will be used) $thumb -> Copyrightfontsize = (int) // The fontsize to use $thumb -> Copyrighttextcolor = (string) // The copyright text color in web format '#000000' $thumb -> Createthumb('imagepath'[,'output']) // Create and output thumbnail Function with 2 values [string]: Filename for the image to convert [string]: Output to the 'screen' (standard) or 'file' (option) $thumb -> Createbase64('imagepath') // Output the thumbnail as base64 encoded data Function with 1 value [string]: Filename for image to convert $thumb -> Createcanvas(i,i,i,s,b) // Create an image from a canvas - use with Createthumb() Function with 5 values [int]: Canvas width in pixels [int]: Canvas height in pixels [int]: Imagetype PHP: IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG [string]: Fill color [boolean]: Transparent (boolean) $thumb -> Create_apng(array, string, int) // Create the APNG thumbnail Function with 3 values [array]: Array with filenames of PNG images (frames) [string]: Filename for APNG: 'animation.png' [int]: Delay between frames in milliseconds $thumb -> Cropimage = (array) // Crop the thumbnail array(0,0,20,20,20,20) Crop image; array with 6 values [0]: 0=disable 1=free crop 2=center crop 3=square crop [1]: 0=percentage 1=pixels [2]: Crop left [3]: Crop right [4]: Crop top [5]: Crop bottom $thumb -> Croprotate = (boolean) // Rotate function that crops the image to fit on the same canvas size D $thumb -> Displacementmap = (array) // Deform the image with a displacementmap Array with 7 values: array(1,'gfx/displacementmap.jpg',0,0,0,50,50) [0]: 0=disable 1=enable [1]: Path to displacement image (grey #808080 is neutral) [2]: 0=resize the map to fit the image 1=keep original map size [3]: X coordinate for map position in px [4]: Y coordinate for map position in px [5]: X displacement scale in px [6]: Y displacement scale in px $thumb -> Displacementmapthumb = (array) // Deform the thumbnail with a displacementmap Array with 7 values: array(1,'gfx/displacementmap.jpg',0,0,0,50,50) [0]: 0=disable 1=enable [1]: Path to displacement image (grey #808080 is neutral) [2]: 0=resize the map to fit the image 1=keep original map size [3]: X coordinate for map position in px [4]: Y coordinate for map position in px [5]: X displacement scale in px [6]: Y displacement scale in px $thumb -> Divisor = (int) // The divisor for the 3x3 filter E $thumb -> Edge = (boolean) // Auto-filter: Edge $thumb -> Emboss = (boolean) // Auto-filter: Emboss F $thumb -> Fliphorizontal = (boolean) // Flips the image over the horizontal axis $thumb -> Flipvertical = (boolean) // Flips the image over the vertical axis $thumb -> Filter = (array) // Matrix of size 3x3 array(-1,-1,-1,-1,8,-1,-1,-1,-1) Filter, array with 9 values [0]: a1,1 [1]: a1,2 [2]: a1,3 [3]: a2,1 [4]: a2,2 [5]: a2,3 [6]: a3,1 [7]: a3,2 [8]: a3,3 $thumb -> Framewidth = (int) // Add a frame around the thumbnail in pixels $thumb -> Framecolor = (string) // The framecolor in web format '#FFFFFF' G $thumb -> Gamma = (array) // Change the gamma of the image array(1,0.5) Array with 2 values [0]: Boolean 0=disable 1=enable [1]: Gamma correction factor $thumb -> Greyscale = (boolean) // Convert to true color grayscale I $thumb -> Inflate = (boolean) // Allow images to be enlarged K $thumb -> Keeptransparency = (boolean) // Keep transparency of original image L $thumb -> Lakefx = (array) // Apply a lake deformation to the image array(1,15,80) Array with 3 values [0]: Boolean 0=disable 1=enable [1]: Density of the waves [2]: Lake area measured from bottom 0 - 100 M $thumb -> Maketransparent = (array) // Make the image transparent array(1,0,'#171915',30) Array with 4 values [0]: Boolean 0=disable 1=enable [1]: 0=PNG 1=GIF [2]: Replacement color in web format: '#FF0000' [3]: RGB tolerance 0 - 100 $thumb -> Mean = (boolean) // Auto-filter: Mean $thumb -> Medianfilter = (boolean) // Apply a median noise reduction filter $thumb -> Mirror = (array) // Apply a mirror effect to the thumbnail array(1,10,70,40,2) Array with 5 values [0]: Boolean 0=disable 1=enable [1]: Mirror transparency gradient starting strength 0 - 100 [2]: Mirror transparency gradient ending strength 0 - 100 [3]: Mirror area 0 - 100 [4]: Mirror 'gap' between original image and reflection in px $thumb -> Mirrorcolor = (string) // The Mirror gradient color in web format '#000000' N $thumb -> Negative = (boolean) // Create image negative O $thumb -> Offset = (int) // The color offset for the filter P $thumb -> Palette = (array) // Change the palette of the image array(1,32) Array with 2 values [0]: Boolean 0=disable 1=enable [1]: Amount of colors for the palette $thumb -> Percentage = (boolean) // Use percentage instead of pixels $thumb -> Perspective = (array) // Apply a perspective to the image array(1,0,20) Array with 3 values [0]: Boolean 0=disable 1=enable [1]: Direction 0=left 1=right 2=top 3=bottom [2]: Perspective strength 0 - 100 $thumb -> Perspectivethumb = (array) // Apply a perspective to the thumbnail array(1,0,20) Array with 3 values [0]: Boolean 0=disable 1=enable [1]: Direction 0=left 1=right 2=top 3=bottom [2]: Perspective strength 0 - 100 $thumb -> Pixelscramble = (array) // Scramble pixels in the image array(1,4,2) Array with 3 values [0]: Boolean 0=disable 1=enable [1]: Pixel range [2]: Repeats (use with care!) $thumb -> Pixelate = (array) // Pixelate the image array(1,10) Array with 2 values [0]: Boolean 0=disable 1=enable [1]: Block size in px $thumb -> Polaroid = (boolean) // Convert the thumbnail to a polaroid look $thumb -> Polaroidtext = (string) // Write a text on the polaroid $thumb -> Polaroidfonttype = (string) // The path to the TTF font $thumb -> Polaroidfontsize = (int) // The fontsize to use $thumb -> Polaroidtextcolor = (string) // The polaroid text color in web format '#000000' $thumb -> Polaroidframecolor = (string) // The polaroid frame color in web format '#FFFFFF' Q $thumb -> Quality = (int) // The output quality of JPG images R $thumb -> Ripplefx = (array) // Apply a ripple deformation to the image array(1,5,15,5,5) Array with 5 values [0]: Boolean 0=disable 1=enable [1]: Amount of horizontal waves [2]: Amplitude of horizontal waves in px [3]: Amount of vertical waves [4]: Amplitude of vertical waves in px $thumb -> Rotate = (int) // Rotate the image in degrees S $thumb -> Shadow = (boolean) // Add a shadow around the thumbnail $thumb -> Shading = (array) // Apply shading to the image array(1,70,80,0) Array with 4 values [0]: Boolean 0=disable 1=enable [1]: Shading strength 0 - 100 [2]: Shading area 0 - 100 [3]: Shading direction 0=right 1=left 2=top 3=bottom $thumb -> Shadingcolor = (string) // The shading gradient color in web format '#000000' $thumb -> Sharpen = (boolean) // Auto-filter: Sharpen $thumb -> Square = (boolean) // Draw thumbnail on a square canvas T $thumb -> Thumbfilename = (string) // New filename (with extension) $thumb -> Thumbheight = (int) // Height of the thumbnail in pixels $thumb -> Thumblocation = (string) // The path to the thumbnail directory $thumb -> Thumbprefix = (string) // The prefix for the thumb filename $thumb -> Thumbsaveas = (string) // Convert the thumbnail to a different format, JPG, GIF or PNG $thumb -> Thumbsize = (int) // Thumbnailsize in pixels for width (landscape) or height (portrait) $thumb -> Thumbwidth = (int) // Width of the thumbnail in pixels $thumb -> Twirlfx = (array) // Apply a twirl deformation to the image array(1,20,0) Array with 3 values [0]: Boolean 0=disable 1=enable [1]: Effect strength 0 to 100 [2]: Direction of twirl 0=clockwise 1=anti-clockwise W $thumb -> Waterdropfx = (array) // Apply a waterdrop deformation to the image array(1,1.2,400,40) Array with 4 values [0]: Boolean 0=disable 1=enable [1]: Amplitude in px [2]: Radius in px [3]: Wavelength in px $thumb -> Watermarkpng = (string) // The path to the watermark PNG image $thumb -> Watermarkposition = (string) // The position of the watermark '50% 50%' is the center $thumb -> Watermarktransparency = (int) // The transparency of the watermark 0 to 100
|
|||||||


Rebecca Wong
Front-End Web Developer
Featured Work
Project One
wwww.portfolio.com/one
Project Two
www.portfolio.com/two
Project Three
www.portfolio.com/three