1 Reply Latest reply on Jan 26, 2008 4:06 AM by niki tsanov

    bitmapData saved with php

    relief8
      I have a flash movie that points to the php code below which opens a new html page and displays the bitmapData as a jpeg. Does anyone know how to make it save the jpeg in a folder instead?

      $data = explode(",", $_POST['fileatt']);
      $width = $_POST['width'];
      $height = $_POST['height'];
      $image=imagecreatetruecolor( $width ,$height );
      $background = imagecolorallocate( $image ,0 , 0 , 0 );
      //Copy pixels
      $i = 0;
      for($x=0; $x<=$width; $x++){
      for($y=0; $y<=$height; $y++){
      $int = hexdec($data[$i++]);
      $color = ImageColorAllocate ($image, 0xFF & ($int >> 0x10), 0xFF & ($int >> 0x8), 0xFF & $int);
      imagesetpixel ( $image , $x , $y , $color );
      }
      }
      //Output image and clean
      header( "Content-type: image/jpeg" );
      ImageJPEG( $image );
      imagedestroy( $image );