Jump to content

Archived

This topic is now archived and is closed to further replies.

onlyican

Swf to JPG

Recommended Posts

Hey all
I have a Flash file, where you can do something, chance something bla bla bla
(Top Secret project, cant say to much, or I will get shot)

Anyway
What I want to do is the finish result from the SWF document, I want converted to web usable image (jpg, gif png ...)

I have seen one example, where there is code in the Flash File, but there is something I dont like about it.

I know I can create an image from a website, a document, and an image.
But how would I create an image from a SWF file???

The person who posts the correct answer, will get a pint on me.

Share this post


Link to post
Share on other sites
you could always load the animation up (the swf) and use alt+[print screen] on your keyboard.

That will take a screen shot... you could load that up in any photo/image editor you have and save it as a jpg.

Chris

Share this post


Link to post
Share on other sites
There is some software called [url=http://www.swftools.org/]SWFTools[/url] that has a command line tool called swfextract which can be used to extract images from an swf file. You could use this tool along with PHPs exec() function to auto-extract frames from the swf - Would this be any use to you?

Share this post


Link to post
Share on other sites
My mistake, I didn't say something right

The SWF, allows someone to create something, say, design a room, moving furniture n stuff

Then I want the PHP script to grab the completed image, so I can use it on the website.
Therefor I can not do printScreen, or Extrernal Apps

Share this post


Link to post
Share on other sites
why couldn't you use external apps? As long as they are installed on the server and are usable from php...

Share this post


Link to post
Share on other sites
[quote author=DaveLinger link=topic=101662.msg402665#msg402665 date=1153758585]
why couldn't you use external apps? As long as they are installed on the server and are usable from php...
[/quote]

because the screen he wishes to capture is within a SWF running on a clients machine.

He esentally needs a way to make flash take a picture of itself, and send it to PHP.

Share this post


Link to post
Share on other sites
So really, this isn't a PHP question. Maybe try a Flash forum? You might get a better response that way...

Share this post


Link to post
Share on other sites
no

The SWF is on the server.
In PHP
You can create an image of a website, and save it a jpg
(imagecreatetruecolor I think, cant remember now)

I want something simular
except the path wont be http://www.example.com
it would be /example.swf

then I get a nice pretty picture of what the flash looks like.

This can be done in flash, by sending all the pixles over to php
then php putting all the pixles together, I just wanted to know if there was an easier option

Share this post


Link to post
Share on other sites
[quote author=onlyican link=topic=101662.msg402755#msg402755 date=1153764617]In PHP
You can create an image of a website, and save it a jpg
(imagecreatetruecolor I think, cant remember now)[/quote]
I'd be interested to know how you've managed to achieve that strictly with PHP...

I don't think you're going to be able to do this without the aid of some third party command line software sitting on the server...

Share this post


Link to post
Share on other sites
ok
Then I will go to option 2

In the Flash File, I get an array of every pixle and the color
Then parse that data to PHP
Then with the pixle information
Create the image

Share this post


Link to post
Share on other sites
How is the array structured? $pixels[ x][ y] ?

Share this post


Link to post
Share on other sites
I dont know yet, I saw information on it somewhere, have not had time to look properly.

Building a new web game. and trying to get something online

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.