{"id":8586,"date":"2014-07-27T05:02:00","date_gmt":"2014-07-26T19:02:00","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=8586"},"modified":"2014-07-27T05:02:00","modified_gmt":"2014-07-26T19:02:00","slug":"php-screen-capture-and-page-speed-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-screen-capture-and-page-speed-primer-tutorial\/","title":{"rendered":"PHP Screen Capture and Page Speed Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ScreenCapture\/\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"PHP Screen Capture and Page Speed Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ScreenCapture\/ScreenCapture.jpg\" title=\"PHP Screen Capture and Page Speed Primer Tutorial\" \/><\/a><p class=\"wp-caption-text\">PHP Screen Capture and Page Speed Primer Tutorial<\/p><\/div>\n<p>Sounds crazy doesn&#8217;t it?  What do <i>PHP Screen Capture<\/i> and <i>Page Speed<\/i> have in common?   Well, nothing really, but these <i>worlds<\/i> met, because the original premise to do a tutorial about &#8220;screen capture in a web way&#8221; panned out to be only straightforward for Windows web server scenarios (ie. WAMP (for example <a target=_blank href='http:\/\/www.easyphp.org' title='EasyPHP WAMP'>EasyPHP<\/a> &#8230; as per image <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/PHP\/ScreenCapture\/ScreenCapture.jpg' title='Click picture'>today<\/a>)), using PHP&#8217;s <a target=_blank href='http:\/\/php.net\/manual\/en\/function.imagegrabscreen.php' title='PHP imagegrabscreen function information'>imagegrabscreen<\/a> function.   Am guessing, but suppose the history behind Windows having easier Screen Capture functionality is the Prnt-Scrn keyboard key that has been there since &#8220;the year dot&#8221; on Windows keyboards.<\/p>\n<p>So, not resorting to third-party install solutions, on this occasion, what else is available out there, and the research led to this useful <a target=_blank href='http:\/\/stackoverflow.com\/questions\/757675\/website-screenshots-using-php\/4526834#4526834' title='Useful advice ... thanks'>webpage<\/a> (thanks) where one of the pieces of advice was to make use of Google&#8217;s (Web) Page Speed tester <a target=_blank href='https:\/\/developers.google.com\/speed\/pagespeed' title='Google Developer Page Speed tester'>here<\/a> where you get a <i>&#8220;mock-up&#8221;<\/i> of what the look of the www.rjmprogramming.com.au (ie. CentOS Linux, not Windows) <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ScreenCapture\/\">webpage<\/a> you are on would be on the Desktop, or as on a Mobile device.  If disappointed (that you really wanted more), try some of those other third-party solutions mentioned at that link mentioned earlier.  It is all very interesting though.<\/p>\n<p>Back to the original premise, hope you know why PHP (or you could have picked other server-side languages, especially ASP.NET (Windows and server-side &#8230; perfect!)) was brought into the picture &#8230; there is an image that will, probably, need to end up being saved to a web server somewhere, so the server-side should be used &#8230; though, do you remember that Javascript method exception with the HTML canvas element mentioned in <a target=_blank href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=7568' title='HTML\/Javascript Canvas Image Copy Tutorial'>HTML\/Javascript Canvas Image Copy Tutorial<\/a> &#8230; curious, huh?<\/p>\n<p>Here is some rudimentary PHP programming source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/ScreenCapture\/MyScreenCapture.php_GETME\" title=\"MyScreenCapture.php\">MyScreenCapture.php<\/a> (where you might notice the use of $_SERVER[&#8216;SERVER_SOFTWARE&#8217;] to test whether you have a Windows Apache web server (ie. WAMP), as distinct from LAMP (you guessed it, Linux) or MAMP (right again, Mac)).<\/p>\n<p>And here is a <a target=_blank href='https:\/\/developers.google.com\/speed\/pagespeed\/insights\/?url=http%3A%2F%2Fwww.rjmprogramming.com.au%2Fwordpress%2F%3Fp=8586' title='This blog post'>link<\/a> to this blog posting tested for speed using Google&#8217;s (Web) Page Speed testing functionality.<\/p>\n<p>If you have a serious need for this screen capture work, hope to get you thinking, at least, today.   Or perhaps it got you thinking about some web page optimization you want help with (where the Google Page Speed tester may come into its own)?<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d8586' onclick='var dv=document.getElementById(\"d8586\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?tag=PHP\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d8586' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Sounds crazy doesn&#8217;t it? What do PHP Screen Capture and Page Speed have in common? Well, nothing really, but these worlds met, because the original premise to do a tutorial about &#8220;screen capture in a web way&#8221; panned out to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-screen-capture-and-page-speed-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[372,513,528,594,932,997,1103,1319,1396,1411,1435],"class_list":["post-8586","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-easyphp","tag-google","tag-google-page-speed","tag-imagegrabscreen","tag-php","tag-programming","tag-screen-capture","tag-tutorial","tag-wamp","tag-web-server","tag-windows"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/8586"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=8586"}],"version-history":[{"count":0,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/8586\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=8586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=8586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=8586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}