I figured this would be an easy task, but googling it hasn't turned up anything...so I'm hoping that you guys can help. So I have a browser based game (using html and javascript). Basically, the player can drag and drop some words and make their own message. Once the user has created their message, I would like them to be able to press a button which takes a screenshot of their message. The idea is to create a gallery of all messages that have been created. I'd prefer to use PHP, since most scripting on the site will be done in PHP (Javascript would be cool, too), but I'm open to any suggestions. I found a couple of threads here that make it sound damn near impossible. Is Flash maybe a better solution? If not Flash, then what?
PHP is on the server side and cannot take screen shots of the user's screen. Neither JavaScript can. You will have to think of another way to achieve this.
Ok, that makes sense...now I feel like an idiot for asking . I just have no clue as to how to approach this.
No need to feel like an idiot! Forums are for asking questions - sometimes it's the quickest way to learn! You may want to post a project on rentacoder or something
Tell your clients to hit the 'PrintScreen' button on their keyboards and paste the image into MSPaint. If you're wanting to save a screen capture, the best way to do it would be create a JAVA applet to take the screenshot and submit it to your site. The Robot class can be used to take the screencapture and the ImageIO class can save the buffer as a jpeg image. I don't know how your script works, but it may be possible to have it generate a list of all the words and their locations, which can be sent to a PHP script which parses this data and generates an image based on the words and their positions with the GD library.
You could create images using the GD library. Let's say there are X words they can drag & drop... After they click on that button you could send positions of all those words to the PHP script and then create an image using that info...
Thanks for the replies...some interesting ideas to try out here. I was hoping for more of a quick fix. When I have some free time and I'm in a programming mood I'll see if I can come up with something (I'll post about it here if I manage to get it working). For now I think I'll just tell the users to take a screenshot and send it in if they really want to. User friendliness is overrated
check the browsershot technology http://browsershots.org/ http://v02.browsershots.org/blog/2006/06/12/technology-preview/ http://v02.browsershots.org/downloads/