PHP How to capture screen

Source: Internet
Author: User
How does PHP capture the screen?

Using PHP to make Web pages under Windows

In Apache's service properties, "Allow service and Desktop Exchange" is checked on the "Login" tab!

?

 
  HWND; $browser->visible = true; $browser->width = $browser->height = $browser->navigate ("http:// Www.un.org ");/* Still working? */while ($browser->busy) {    

Run this code when the server will pop up an IE window and automatically open the specified site, the screen after the window automatically closed, quite a fool!

?

?

?

?

?

Use PHP to make Web pages under Linux

On the Alexa, always see the Alexa display is queried the homepage of the site, this is how to achieve it.
By looking at the content of the page, it turns out that it was by calling Amazon's serviceprogramObtained.
http://ast.amazonaws.com/xino/?action=redirect&service=alexasitethumbnail&url=baidu.com&
awsaccesskeyid=1fvz0jnejda5tk457cr2&signature=tz4xyqdncsf8a1v%2bpdo4todvm9c%3d&
size=small&timestamp=2008-03-04t06%3a04%3a47.422z&
Defaultimage=http%3a%2f%2fclient.alexa.com%2fcommon%2fimages%2fnoimages.gif
If you want to do this in your own web site, you can simply request an ID from Amazon to get such a calling interface.
But how does this fit the spirit of inquiry? So, after some rummaging, find the following method to implement the homepage of the website.

To achieve the site home page thumbnail image production.
Steps:
1. Start a page crawler, crawl the selected site homepage;
2. Store crawled pages toServerOn
3. Handle the crawled pages as needed for the size of the display;
4. Show the results toUser。
To sum up, in fact, the key is to have a stable crawler, after searching on the Internet, find the following several tools.

In the Windows environment, you can consider this tool software to capture the page:
IECapt.exe
In the Linux environment, you can consider this tool software to capture the page:
Html2image
Once you have the crawler, you can take any kind of serverlanguageWrite the program, call the crawler, and then return the crawl results to the user.
Here's an example of using IECapt.exe and combining PHP to crawl a website.
Run through under windows/apache2.2/php5.2.5.

Resources:
1.http://www.zubrag.com/scripts/website-thumbnail-generator.php
2.http://www.guangmingsoft.net/htmlsnapshot/html2image.htm

Official URL:http://www.guangmingsoft.net/htmlsnapshot/html2image.htm
Linuxkernel-2.2.14 and above: installation of necessary lib and related software
Yum install-y glibc GTK + fontconfig?? Cairo Libpixman Pango Pango-devel
Download Html2image
Wgethttp://www.guangmingsoft.net/htmlsnapshot/html2image.i386.tar.gz
Tar xvzf html2image.i386.tar.gz
CD Html2image
Set Ld_library_path path
Export ld_library_path=./
Mkdir/usr/x11r6/lib
Ln-s/usr/share/x11/usr/x11r6/lib/x11
Run Xvfb
./xvfb:1-screen 0 640x480x24-nolisten tcp-audit 4-auth x1.cfg & Export Display=:1
Create a picture
./html2imagewww.google.comA.jpg
Errors that can be ignored:
Error opening security Policy File/usr/x11r6/lib/x11/xserver/securitypolicy
Could not init font path element/usr/x11r6/lib/x11/fonts/ttf/, removing from list!
Could not init font path element/usr/x11r6/lib/x11/fonts/speedo/, removing from list!
Could not init font path element/usr/x11r6/lib/x11/fonts/type1/, removing from list!
Could not init font path Element/usr/x11r6/lib/x11/fonts/cid/, removing from list!
Generate 1024x768 format capacity
JPG 871K
GIF 4.12M
PNG 1.13M

  • Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.