Jump to content


Photo

Swf to JPG


  • Please log in to reply
11 replies to this topic

#1 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 July 2006 - 12:47 PM

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.
Tell me the problem, I will try tell you the solution

#2 lead2gold

lead2gold
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts
  • LocationOttawa, On

Posted 24 July 2006 - 12:54 PM

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

#3 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 24 July 2006 - 03:58 PM

There is some software called SWFTools 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?

#4 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 July 2006 - 04:08 PM

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
Tell me the problem, I will try tell you the solution

#5 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 24 July 2006 - 04:29 PM

why couldn't you use external apps? As long as they are installed on the server and are usable from php...
http://www.DaveLinger.com
dave at linger dot com

#6 Joe Haley

Joe Haley
  • Members
  • PipPipPip
  • Advanced Member
  • 103 posts
  • LocationCanada, eh?

Posted 24 July 2006 - 04:36 PM

why couldn't you use external apps? As long as they are installed on the server and are usable from php...


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.
Give a man a fish; you have fed him for today.  Teach a man to fish; and you have fed him for a lifetime
Don't teach men to program. Teach them to fish.

Please, try the RTFM solution before asking for help:
http://php.net/manual/en/index.php

#7 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 24 July 2006 - 04:38 PM

So really, this isn't a PHP question. Maybe try a Flash forum? You might get a better response that way...

#8 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 July 2006 - 06:10 PM

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
Tell me the problem, I will try tell you the solution

#9 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 24 July 2006 - 07:49 PM

In PHP
You can create an image of a website, and save it a jpg
(imagecreatetruecolor I think, cant remember now)

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...

#10 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 July 2006 - 08:22 PM

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
Tell me the problem, I will try tell you the solution

#11 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 24 July 2006 - 09:06 PM

How is the array structured? $pixels[ x][ y] ?

#12 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 24 July 2006 - 09:22 PM

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
Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users