grid (version 3.0.3)

grid.cap: Capture a raster image

Description

Capture the current contents of a graphics device as a raster (bitmap) image.

Usage

grid.cap()

Arguments

Value

A matrix of R colour names.

Details

This function is only implemented for on-screen graphics devices.

See Also

grid.raster

dev.capabilities to see if it is supported.

Examples

Run this code
## Not run: 
# dev.new(width=.5, height=.5)
# grid.rect()
# grid.text("hi")
# cap <- grid.cap()
# dev.off()
# 
# grid.raster(cap, width=.5, height=.5, interpolate=FALSE)
# ## End(Not run)

Run the code above in your browser using DataCamp Workspace