Hi,
I am new in php coding. I want to get image data from php and also display in flash.
I want to know... how to read and display imagejpeg( $imgData ); from php.
I am able to get php data in flash through below method...
/* AS3 */------------------
var src:String = "pic.jpg";
var width:String = "250";
var height:String = "250";
var urlReq:URLRequest = new URLRequest(src);
var urlLoader:URLLoader = new URLLoader();
var urlVar:URLVariable = new URLVariable();
urlVar.src= src;
urlReq.mehtod = URLRequestMethod.POST;
urlReq.data = urlVar;
urlLoader.load ( urlReq );
urlLoader.addEventListener(Event.Complete, doneProcFnc)
function doneProcFnc(ev:Event):void{
trace ( "data access from php done" );
}
------------/* */
/* PHP */
$src = $_POST [ 'src' ];
$wd = $_POST [ ' width' ];
$ht = $_POST [ ' height' ];
/* this function will create one black color area for croping refence */
$cropImg = imagecreatetruecolor ( cropImageWd, cropImageHt );
/* this function will reproduce particular image required width and height without reducing the image quality */
imagecopyresampled ( cropImage , sourceImage, destX , destY, sourX, sourY, ect... );
imagejpeg( $imgData ) ;
------------------/* */
Now, here the problem comes. I don't know how to display that imagejpeg data into flash.
I need help.
Thanks.
Thanks.
No.No.No. I am not loading image from folder.
step1 : I m sending some image information to php (src , width , height)
step2 : PHP code will take that information
step3 : PHP code will crop that particular image (some calcution for quality)
step4 : PHP code will generate some image data that is /* imagejpeg( $imgData ) */ and return back to flash
step5 : Now the problem occur, how can i take that image data in flash or what form
Possibilities :
? should i get image data as text format and it needs to be encoded (like jpeg encoder)
? i don't know i already try jpegencoder but i did not get anything
? ? ?
var src:String = "pic.jpg";
var width:String = "250";
var height:String = "250";
var urlReq:URLRequest = new URLRequest(src);
var urlLoader:URLLoader = new URLLoader();
var urlVar:URLVariable = new URLVariable();
urlVar.src= src;
urlReq.mehtod = URLRequestMethod.POST;
urlReq.data = urlVar;
urlLoader.load ( urlReq );
urlLoader.addEventListener(Event.Complete, doneProcFnc)
function doneProcFnc(ev:Event):void{
trace ( "data access from php done" + ev.target );
// imagejpeg( $imgData )
}
------------/* */
/* PHP */
$src = $_POST [ 'src' ];
$wd = $_POST [ ' width' ];
$ht = $_POST [ ' height' ];
/* this function will create one black color area for croping refence */
$cropImg = imagecreatetruecolor ( cropImageWd, cropImageHt );
/* this function will reproduce particular image required width and height without reducing the image quality */
imagecopyresampled ( cropImage , sourceImage, destX , destY, sourX, sourY, ect... );
imagejpeg( $imgData ) ;
North America
Europe, Middle East and Africa
Asia Pacific