This article is an example of how PHP implements a screenshot of a Web page by executing the CUTYCAPT command. Share to everyone for your reference, specific as follows:
Using EXEC to execute commands with PHP
PS. The EXEC function is disabled by default, open php.ini check disable_function Whether it contains this or, remove
Copy Code code as follows:
EXEC (' xvfb-run--server-args= "-screen 0, 1024x768x24" cutycapt--url=http://www.jb51.net--out=2.jpg ');
A problem in this one my picture is only the first screen, so crop the picture
Copy Code code as follows:
to crop using Convert-crop
Copy Code code as follows:
Convert-crop 1024x768+0+0 2.jpg 22.jpg
Use convert-resize for picture scaling
Copy Code code as follows:
Convert-resize 15%x15% 22.jpg 22.jpg
For more information on PHP related content readers can view the site topics: "PHP graphics and pictures Operating skills summary", "Basic PHP Grammar Introductory Course", "PHP Operations and Operator Usage Summary", "PHP object-oriented Program Design Introductory Course", "PHP Network Programming Skills Summary", "PHP array (Array) Operations tips Encyclopedia, "PHP string (String) Usage Summary", "Php+mysql Database operation Introduction Tutorial" and "PHP Common database Operation tips Summary"
I hope this article will help you with the PHP program design.