setDimension(550,400); $movie->setBackground(rand(0,0xFF),rand(0,0xFF),rand(0,0xFF)); $movie->setRate(31); // some variables $imageSrc="apples.jpg"; $pixels=4; // $pixels = number of pixels to skip (min 1) //(ie 1 = get all pixel info, 4 = get every 4th pixel etc) // get some image data $im = @imagecreatefromjpeg ($imageSrc); $imageInfo = getimagesize($imageSrc); $w = $imageInfo[0]; $h = $imageInfo[1]; // make a shape with ming and draw it using image data for($j=0;$j<$h;$j+=$pixels){ $line=new SWFShape(); $line->movePenTo(0,$j); for($i=0;$i<$w;$i+=$pixels){ $colInd = imagecolorat($im, $i, $j); $colArr = imagecolorsforindex($im, $colInd); $line->setLine(2,$colArr["red"] ,$colArr["green"], $colArr["blue"]); $line->drawLineTo($i+$pixels,$j); } $l=$movie->add($line); $l->moveTo(10,10); } // save swf with same name as filename $swfname = basename(__FILE__,".php"); $movie->save("$swfname.swf",9); ?>