Difference between revisions of "ImageData:encode"
(Save directory, hint hint.) |
(Updated for 0.10.0) |
||
Line 1: | Line 1: | ||
− | Encodes the ImageData and writes it to the save directory. | + | Encodes the ImageData and optionally writes it to the save directory. |
+ | |||
+ | == Function == | ||
+ | {{newin|[[0.10.0]]|100|type=variant}} | ||
+ | === Synopsis === | ||
+ | <source lang="lua"> | ||
+ | filedata = ImageData:encode( format, filename ) | ||
+ | </source> | ||
+ | === Arguments === | ||
+ | {{param|ImageFormat|format|The format to encode the image as.}} | ||
+ | {{param|string|filename (nil)|The filename to write the file to. If nil, no file will be written but the FileData will still be returned.}} | ||
+ | === Returns === | ||
+ | {{param|FileData|filedata|The encoded image as a new FileData object.}} | ||
== Function == | == Function == | ||
{{newin|[[0.8.0]]|080|type=variant}} | {{newin|[[0.8.0]]|080|type=variant}} | ||
+ | {{oldin|[[0.10.0]]|100|type=variant}} | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> | ||
Line 14: | Line 27: | ||
== Function == | == Function == | ||
{{newin|[[0.8.0]]|080|type=variant}} | {{newin|[[0.8.0]]|080|type=variant}} | ||
+ | {{oldin|[[0.10.0]]|100|type=variant}} | ||
=== Synopsis === | === Synopsis === | ||
<source lang="lua"> | <source lang="lua"> |
Revision as of 02:51, 17 December 2015
Encodes the ImageData and optionally writes it to the save directory.
Contents
Function
Available since LÖVE 0.10.0 |
This variant is not supported in earlier versions. |
Synopsis
filedata = ImageData:encode( format, filename )
Arguments
ImageFormat format
- The format to encode the image as.
string filename (nil)
- The filename to write the file to. If nil, no file will be written but the FileData will still be returned.
Returns
FileData filedata
- The encoded image as a new FileData object.
Function
Available since LÖVE 0.8.0 |
This variant is not supported in earlier versions. |
Removed in LÖVE 0.10.0 |
This variant is not supported in that and later versions. |
Synopsis
ImageData:encode( outFile )
Arguments
string outFile
- Name of a file to write encoded data to. The format will be automatically deduced from the file extension.
Returns
Nothing.
Function
Available since LÖVE 0.8.0 |
This variant is not supported in earlier versions. |
Removed in LÖVE 0.10.0 |
This variant is not supported in that and later versions. |
Synopsis
ImageData:encode( outFile, format )
Arguments
string outFile
- Name of a file to write encoded data to.
ImageFormat format
- The format to encode the image in.
Returns
Nothing.
Function
Removed in LÖVE 0.8.0 |
This variant is not supported in that and later versions. |
Synopsis
data = ImageData:encode( format )
Arguments
ImageFormat format
- The format to encode the image in.
Returns
Data data
- The encoded image data.
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info