image2swf: Convert bitmap images to SWF

Description Usage Arguments Details Value Author(s) Examples

View source: R/xx2swf.R

Description

Given the file names of a sequence of images, this function can convert them into a Flash file (.swf). Supported input formats are jpg/jpeg and png. The two formats are allowed to appear in the same sequence.

Usage

1
2
  image2swf(input, output = "movie.swf", bgColor = "white",
    interval = 1)

Arguments

input

the file names of the images to be converted

output

the name of the output SWF file

bgColor

background color of the output SWF file

interval

the time interval (in seconds) between animation frames

Details

This function uses the Ming library (http://www.libming.org/) to implement the conversion. If you want to create a Flash file consisting of vector graphics, use svg2swf() instead.

Value

The name of the generated swf file if successful.

Author(s)

Yixuan Qiu <yixuan.qiu@cos.name>

Examples

1
2
3
4
5
6
7
8
9
if(capabilities("png")) {
  olddir = setwd(tempdir())
  png("Rplot%03d.png")
  for(i in 1:9) plot(runif(20), ylim = c(0, 1))
  dev.off()
  output = image2swf(sprintf("Rplot%03d.png", 1:9))
  swf2html(output)
  setwd(olddir)
}

yixuan/R2SWF-archive documentation built on May 4, 2019, 5:28 p.m.