image2swf: Convert bitmap images to SWF

View source: R/xx2swf.R

image2swfR Documentation

Convert bitmap images to SWF

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

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 (https://github.com/libming/libming) 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 <https://statr.me>

Examples

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)
}


R2SWF documentation built on June 22, 2024, 11:05 a.m.