par
carasco » 11 mai 2011, 17:15
Bonjour,
j'ai donc commencé mes script par contre je suis bloqué à un endroit. j'utilise de l'ajax pour l'affichage de l'image mais je ne sais pas comment passer l'image à mon code JS.
Voic le code exemple que j'utilise :
header("Content-type: image/png");
$image = imagecreatefrompng("sig.png");
$image2 = imagecreatefromjpeg("logo.jpg");
//imagecolorallocate($image, R, G, B) in HEX values
$font_black = imagecolorallocate($image, 2, 1, 8);
$font_blue = imagecolorallocate($image, 25, 0, 255);
//($image, fontsize, rightindent, downindent, data, txtcolour)
imagestring($image, 6, 40, 6, "texteaaffciher", $font_black);
imagecopyresized($image, $image2, 10, 4, 0, 0, 25, 25, 46, 45);
imagepng($image,'http://www.forsaken-world.fr/nomdufichier.png');
echo $image;
Grâce a un alert() dans mon js j'ai constaté que le echo me renvoyait : Resource id #135
Cooment puis je envoyer mon image à mon js, s'il vous plait?
Bonjour,
j'ai donc commencé mes script par contre je suis bloqué à un endroit. j'utilise de l'ajax pour l'affichage de l'image mais je ne sais pas comment passer l'image à mon code JS.
Voic le code exemple que j'utilise :
[php]header("Content-type: image/png");
$image = imagecreatefrompng("sig.png");
$image2 = imagecreatefromjpeg("logo.jpg");
//imagecolorallocate($image, R, G, B) in HEX values
$font_black = imagecolorallocate($image, 2, 1, 8);
$font_blue = imagecolorallocate($image, 25, 0, 255);
//($image, fontsize, rightindent, downindent, data, txtcolour)
imagestring($image, 6, 40, 6, "texteaaffciher", $font_black);
imagecopyresized($image, $image2, 10, 4, 0, 0, 25, 25, 46, 45);
imagepng($image,'http://www.forsaken-world.fr/nomdufichier.png');
echo $image;
[/php]
Grâce a un alert() dans mon js j'ai constaté que le echo me renvoyait : Resource id #135
Cooment puis je envoyer mon image à mon js, s'il vous plait?