LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-08-2009, 08:59 AM   #1
z-kzn-z
LQ Newbie
 
Registered: Sep 2009
Location: Crimea, Ukraine
Distribution: Gentoo
Posts: 3

Rep: Reputation: 0
take a screenshot of swf file


1. Sorry for my bad english
2. Please, help me

I need to take a screenshot of swf and save it as image file. I found this: http://www.mail-archive.com/swfdec@l.../msg00403.html
I wrote something like this:
Code:
#include <stdlib.h>
#include <iostream>
#include <swfdec/swfdec.h>
#include <cairo.h>

using namespace std;

void swfdec_player_save (SwfdecPlayer *player, guint width, guint height, const char *filename) {
	cairo_surface_t *surface;
	cairo_t *cr;

	surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
	cr = cairo_create (surface);
	swfdec_player_render (player, cr);
	cairo_destroy (cr);
	cairo_surface_write_to_png (surface, filename);
	cairo_surface_destroy (surface);
}

int main(int argc, char *argv[]) {
	char *input = argv[1];
	char *output = argv[2];
	
	SwfdecPlayer *player = swfdec_player_new(NULL);
	SwfdecURL *url = swfdec_url_new_from_input(input);
	swfdec_player_set_url(player, url);
	
	swfdec_player_save(player, 300, 300, output);

	return 0;
}
, but it doesn't save screenshot to file, it save just empty png file with transparent background.
How can I fix it?
 
Old 11-09-2009, 01:42 PM   #2
HaroldWho
Member
 
Registered: Nov 2006
Location: southeastern PA
Distribution: Slackware
Posts: 130

Rep: Reputation: 23
If all you want is a screenshot saved in a file, and if you have ImageMagick installed, why not just enter 'import image.png' in an xterm, and outline the image with the "crosshair" cursor?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
swf file on samba share ssilayaraja Linux - Software 1 07-05-2008 05:54 AM
What software is best for open swf file? tahrenyie85 Linux - Software 2 01-09-2008 05:28 AM
how to play the *.swf file ztdep Linux - Software 4 01-12-2006 08:37 PM
Which application to read .swf file satimis Linux - Software 4 07-08-2005 11:01 PM
can't see a swf file in open office CiScOh4x0r Ubuntu 1 06-03-2005 01:16 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration