PHP's method of intercepting IE browser and narrowing down the source image

Source: Internet
Author: User
This article mainly introduces PHP's method of intercepting IE browsers and narrowing down the source image. it involves related techniques related to PHP's calling the com component to achieve image capturing, for more information about how to use PHP to intercept IE browsers and narrow down the source image, see the following example. We will share this with you for your reference. The details are as follows:

// Capture a window (IE for example) $ ie = new COM ("InternetExplorer. application "); $ ie-> Navigate2 ($ webaddress); $ oWSH = new COM (" WScript. shell "); while ($ ie-> ReadyState! = 4) usleep (10000); $ handle = $ ie-> HWND; $ ie-> Visible = true; while ($ ie-> Busy) {com_message_pump (4000 );} $ im = imagegrabwindow ($ handle, 0); $ ie-> Quit (); $ file = "public/images /". time (). "iesnap.png"; imagepng ($ im, $ file); // ------------------ $ browser = new COM ("InternetExplorer. application "); $ handle = $ browser-> HWND; $ browser-> Visible = true; $ browser-> FullScreen = true; $ browser-> Navigate ($ webaddress ); while ($ browser-> Busy) {com_message_pump (4000);} $ im = imagegrabwindow ($ handle, 0); $ browser-> Quit (); // opendir ("public/images/"); $ new_img = imagecreatetruecolor ("206", "132"); $ file = "public/images /". time (). "ie.png"; imagecopyresampled ($ new_img, $ im, 206,132,206,142,102,); imagepng ($ new_img, $ file); imagedestroy ($ new_img );

If you have any questions, choose desktop and program interaction.

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.