• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

How to automate the capture of Gi''s or Jpg"s from a Flash program.

Experts,

We have a specification to develop data driven graphics for one of the projects in our shop. Weve prototyped this with Flash using an Xml file from our database and ActionScript to arrange and color the elements within our graphic.

All works well except were at a loss to generate the Gif or Jpg files. If we publish to a Gif or Jpg, we only get the Flash Frame without the action scripts running (thus no population of the data).  If we run the swf file the graphic is populated, but we then have to capture the graphic by hand with another tool.  Would any of you know how to automate the process to capture several hundred Gifs or Jpgs?


Sincerely,


Bill Fleury
0
Fleurys
Asked:
Fleurys
  • 3
  • 2
  • 2
  • +2
2 Solutions
 
blue-genieCommented:
Hi, i'm not understanding your question, but your application is supposed to load an image, arrange it and color it then output an image? is that right?
you won't be able to achieve that in flash alone, not sure what you'd use, but first lets pinpoint if that's what you mean.
0
 
FleurysAuthor Commented:
No, the swf reads an xml file and uses this information to draw the appropriate graphic in Flash. Once the graphic has been rendered we then need to export it to a Jpg. The export process is what I'm inquiring about; it should be some form of atomation as we will have to do this for several hundred graphics.

regards
0
 
najhCommented:
Flash SWF's and executables don't have the ability to export and save JPG (or any other) graphics natively. (the flash environment does, but that's different)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
FleurysAuthor Commented:
I thank the both of your for your response's, it's nice to correspond with people who are familiar with the Flash product.

I've taken note of your point,  but is there not a workaround or non-native soltion to this problem. A solution that requires some programming (ms visual studio) or something that works in combination with another program would be acceptible. It has to be an automated process though, we can't have someone doing them one at a time.
0
 
blue-genieCommented:
a few years ago my then boss decided i have to create a flash collaborative whiteboard where the users can draw and write to their heart's content and then click a button and it saves the content as a jpeg on the users harddrive.
Hence, she's no longer my boss :-)

seriously, i'm sure it can be done, but not with flash. I remember speaking to a java programmer who went off about storing the pixels as bits with their colour properties and then remapping those pixels and applying them.... at that point I lost interest.

You might want to post the question in the programming section, one of them might be able to help you.
0
 
najhCommented:
It may be possible in flash with, for example VB etc. I know you can load an SWF into there and therefore you could have some kind of collaborative solution. Have a go at putting an SWF object into one of the visual studio languages you're familiar with and see how that progresses. I haven't a clue how to do things like screen grabs and the like in VB / C++ but presumably it can't be that hard. Then you just have to save whatever you've grabbed as a JPEG.
0
 
Jakob_ECommented:
This is fun - a task with numberous solutions...
For now - three ideas to get you started

1) Do you need a jpeg output?
Couldn't you just record the changes and then reproduce the image in flash using the
source and the recorded data?

2) Try take a look at flash's BitmapData it may be (F1) helpfull

3) If you need to save images you must pass the image info to the server to handle the
    "FSO-thing" or whatever component or such you have available.
   
~ Jakob E
0
 
The_Blasted_OneCommented:
I had the similar task several years ago.
The most suitable method I know is to use any good screen capture program in conjunction with automation utility (I prefer http://www.autohotkey.com , it is free).
If automation utility is flexible enough, you can even make "PrintScreen - Paste in Photoshop - Crop - Save for Web" sequence, although it is rather odd way.
Or simply use screen capture program that creates png screenshot by pressing hotkey, you can set it up to capture only the screen region you need or you can make a batch crop later in Photoshop.

Note: it may be better to create "debug mode" actionscript for your flash to sequence all the screens you need to capture. Maybe changing frames by pressing "spacebar", it will be easier to automate via automation utility. This could save you many hours if you will need to repeat the procedure later.
0
 
FleurysAuthor Commented:
Thanks all for your responses,

Ive made a little progress, some with your suggestions and some on my own initiative. Basically, Ive used an application called SnagIt (cost $40) which among its other attributes has the ability to establish a printer port that it will monitor (similar to a PDF Printer in Adobe Acrobat). Within the action script Ive issued a print command which causes a dialog box to appear, I choose the appropriate printer and the SnagIt Program will then grab the image, crop it and save it as a jpg into a predefined folder.

This process works well for one image. I then modified the action script to first accept a master list which contains the names of all the data xml files to convert. A second routine will then read each data xml file in turn and issue a print command (using the print.addpage method. This should output a single multipage document which SnagIt or Acrobat can both be configured to export as single page jpgs.

My current problem has to do with opening the data xml files in the second routine. It seems once Ive opened an xml file, the second attempt to declare and open an xml file fails and returns a null. Im not certain whats going on. Do any of you have any ideas ?


Regards,

Bill

PS. Jakob  I not certain I have a need for the BitmapData  in actionscript, but it sounds interesting and Ill try to read through it today.

The blasted One: - Ive taken a look at the Auto HotKey program but believe I stay with SnagIt for now.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now