\HeaderA{savePlot}{Save Cairo X11 Plot to File}{savePlot}
\keyword{utilities}{savePlot}
\begin{Description}\relax
Save the current page of a cairo \code{\LinkA{X11}{X11}()} device to a file.
\end{Description}
\begin{Usage}
\begin{verbatim}
savePlot(filename = paste("Rplot", type, sep="."),
         type = c("png", "jpeg", "tiff", "bmp"),
         device = dev.cur())
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{filename}] filename to save to.
\item[\code{type}] file type: only \code{"png"} will be accepted for cairo
version 1.0.
\item[\code{device}] the device to save from.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Only \code{X11} devices of types \code{"cairo"} and \code{"nbcairo"}
are supported.

This works by copying the image surface to a file.  For PNG
will always be a 24-bit per pixel PNG \sQuote{DirectClass} file, for
JPEG the quality is 75\% and for TIFF there is no compression.

At present the plot is saved after rendering onto the canvas (default
opaque white), so for the default \code{bg = "transparent"} the
effective background colour is the canvas colour.
\end{Details}
\begin{Value}
Invisible \code{NULL}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{X11}{X11}}, \code{\LinkA{dev.copy}{dev.copy}}, \code{\LinkA{dev.print}{dev.print}}
\end{SeeAlso}

