In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you how to zoom pictures and add watermarks to pictures in php, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
There are two ways to resize an image.
(1): the ImageCopyResized () function is valid in all GD versions, but its image scaling algorithm is rough.
(2): ImageCopyResampled (), the edge of the image obtained by its pixel interpolation algorithm is smooth. The quality is good (but this function is slower than ImageCopyResized ()).
The arguments of the two functions are the same. It is as follows:
ImageCopyResampled (dest,src,dx,dy,sx,sy,dw,dh,sw,sh)
ImageCopyResized (dest,src,dx,dy,sx,sy,dw,dh,sw,sh)
Both of them capture a specific location (sx,sy) from the original image (sx,sy) and copy the image qu region to a specific location (dx,dy) of the target t image (destination). In addition, dw,dh specifies the size of the copied image area on the target image, and sw,sh specifies the size of the image area copied from the original image. If you have ps experience, it is equivalent to selecting a region in the original image, cutting and moving to the target image, while stretching or zooming out.
Example 1:
(in this example, the picture is displayed as the original size of 4x1.)
The copy code is as follows:
Recommend a simple and practical tool for zooming pictures, SimpleImage, refer to http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/
How to use it:
The copy code is as follows:
Set width, scale proportionally
Set height, scale proportionally
Scale to 50%
Zoom and output directly to the screen
Please click on the link at the beginning of the article to download the SimpleImage.php source code.
Watermark the picture
The copy code is as follows:
The above is all the contents of the article "how to scale pictures and add watermarks to pictures in php". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.