Php imagecreatefromgifImagecreatefromgif ($ filename)Imagecreatefromgif () returns an image identifier representing the image obtained from the given file name$ Filename is the GIF image name.View instanceFunction LoadGif ($ imgname){/* Attempt to
12. 3 The generation of automatic miniature graphsBecause of the large amount of data in the picture, the transfer process is relatively long, so when users browse the picture, often want to firstDisplays a thumbnail of a picture.Although you can
Here once to support the upload of 2 pictures, upload the original and poor quality of the picture, the original image for the preservation of high quality pictures, poor quality of the graphic for Web page display.
PHP Code
Copy Code code as
Simply write a PHP image upload, can support JPG, PNG, GIF and other formats of the picture, if you want to support more formats, such as BMP, you can expand their own. It is not object-oriented, and is simply recorded here for later access.
This
The following provides three code generation, compatibility is quite good, you can also customize the height and width oh.
function Imageresize ($srcfile, $tow, $toh, $tofile = "")
{
if ($tofile = = "") {$tofile = $srcfile;}
$info = "";
$data
I learned several functions from the image function section of PHP every day. I think that in the course of learning, you need to know how to "play" and make a point.
PHP beginners!After reading this question, I think the title has become demon
You can simply write a PHP image upload file that supports jpg, png, gif, and other formats. if you want to support more formats, such as bmp, you can expand it by yourself. It is not object-oriented. here we will simply record it so that we can use
Php generates a thumbnail. although you can specify the image width and height in HTML to scale the image at will, this method does not reduce the number of pixels of the image. The size of the image file has not changed, and of course the image
Php generates a thumbnail code. For more information, see. the transfer process is relatively long because the image data volume is large, you often want to display a thumbnail of an image. although you can scale the image at will by specifying the
Php text watermark and thumbnail implementation code. ImageCreateFrom * the image loading function loads images with different suffixes: imagecreatefromgifimagecreatefrom?imagecreatefrompngimagecreatefromwbmp imagecreatefromstring in the format of
The following provides three generated reduction codes, which have good compatibility. You can also customize the height and width.Function imageresize ($ srcfile, $ tow, $ toh, $ tofile = ""){ If ($ tofile = "") {$ tofile = $ srcfile ;}$ Info = "";$
The following provides three generated reduction codes, which have good compatibility. You can also customize the height and width.
Function imageresize ($ srcfile, $ tow, $ toh, $ tofile = "")
{
If ($ tofile = "") {$ tofile = $ srcfile ;}
$
The generation of automatic miniature graphsBecause of the large amount of data in the picture, the transfer process is relatively long, so when users browse the picture, often want to firstDisplays a thumbnail of a picture.Although you can scale
I think in the process of learning, we should know "play", create a sense of achievement, so that the effect of learning and enthusiasm will be very high,
Will be more like their own learning things!
An example is provided:
Today, I learned some
Beginner php! Look at this topic, I feel the title demon again! But I think, perhaps my idea may give everybody the study to some ideas!
Beginner php!Look at this topic, I feel the title demon again!But I think, perhaps my idea may give everybody
The code is as follows
Copy Code
Original image $DST = "/upload/20120914/20120914040740-0.jpg"; Note that the picture path should be correct Get the original picture information $DST _info = getimagesize ($DST); Switch ($DST _info[2]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.