xploit Posted November 2, 2009 at 05:54 AM Report Share #294346 Posted November 2, 2009 at 05:54 AM Boas Tenho uma dúvida, imaginemos tenho a div desenho (<div id="desenho">), dentro desta div está um desenho feito através de javascript, agora como faco para fazer uma cópia do desenho feito na (div desenho) e guardar para um jpg.. isto é possivel? Link to comment Share on other sites More sharing options...
IceBrain Posted November 2, 2009 at 11:39 AM Report Share #294356 Posted November 2, 2009 at 11:39 AM Com <div> não é possível. Segundo me parece, tens duas opções, mas nenhuma é grande coisa: - Em vez de gerar a imagem JPG em Javascript, envias os dados com os quais fizeste o desenho para um script no servidor, e é esse script que renderiza a imagem e a manda para o cliente. - Podes usar a nova tag <canvas>, que tem funções para aceder aos píxeis diretamente, mas ficas limitado às últimas versões do Firefox, Opera e Safari (sem IE): http://blog.nihilogic.dk/2008/04/saving-canvas-data-to-image-file.html ❝The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.❞- John Carmack on software patents A list of command line apps Link to comment Share on other sites More sharing options...
yoda Posted November 2, 2009 at 09:00 PM Report Share #294405 Posted November 2, 2009 at 09:00 PM Podes guardar as coordenadas do que desenhas e valores no javascript enquanto fazes o desenho, e no fim enviar para o php usando a biblioteca GD para receber os valores e reproduzir o desenho. before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now