BMP IO

Read and write BMP images.

Summary
BMP IORead and write BMP images.
Functions
gdImageBmpPtrOutputs the given image as BMP data, but using a gdIOCtx instead of a file.
gdImageBmpgdImageBmp outputs the specified image to the specified file in BMP format.
gdImageBmpCtxOutputs the given image as BMP data, but using a gdIOCtx instead of a file.
gdImageCreateFromBmp
gdImageCreateFromBmpPtr
gdImageCreateFromBmpCtx

Functions

gdImageBmpPtr

void * gdImageBmpPtr(gdImagePtr im,
int *size,
int compression)

Outputs the given image as BMP data, but using a gdIOCtx instead of a file.  See gdImageBmp.

Parameters

imthe image to save.
sizeOutput: size in bytes of the result.
compressionwhether to apply RLE or not.

Returns

A pointer to memory containing the image data or NULL on error.

gdImageBmp

void gdImageBmp(gdImagePtr im,
FILE *outFile,
int compression)

gdImageBmp outputs the specified image to the specified file in BMP format.  The file must be open for writing.  Under MSDOS and all versions of Windows, it is important to use “wb” as opposed to simply “w” as the mode when opening the file, and under Unix there is no penalty for doing so.  gdImageBmp does not close the file; your code must do so.

In addition, gdImageBmp allows to specify whether RLE compression should be applied.

Variants

gdImageBmpCtx write via a gdIOCtx instead of a file handle.

gdImageBmpPtr store the image file to memory.

Parameters

imthe image to save.
outFilethe output FILE* object.
compressionwhether to apply RLE or not.

Returns

nothing

gdImageBmpCtx

void gdImageBmpCtx(gdImagePtr im,
gdIOCtxPtr out,
int compression)

Outputs the given image as BMP data, but using a gdIOCtx instead of a file.  See gdImageBmp.

Parameters

imthe image to save.
outthe gdIOCtx to write to.
compressionwhether to apply RLE or not.

gdImageCreateFromBmp

gdImagePtr gdImageCreateFromBmp(FILE *inFile)

gdImageCreateFromBmpPtr

gdImagePtr gdImageCreateFromBmpPtr(int size,
void *data)

gdImageCreateFromBmpCtx

gdImagePtr gdImageCreateFromBmpCtx(gdIOCtxPtr infile)
void * gdImageBmpPtr(gdImagePtr im,
int *size,
int compression)
Outputs the given image as BMP data, but using a gdIOCtx instead of a file.
gdIOCtx structures hold function pointers for doing image IO.
void gdImageBmp(gdImagePtr im,
FILE *outFile,
int compression)
gdImageBmp outputs the specified image to the specified file in BMP format.
void gdImageBmpCtx(gdImagePtr im,
gdIOCtxPtr out,
int compression)
Outputs the given image as BMP data, but using a gdIOCtx instead of a file.
gdImagePtr gdImageCreateFromBmp(FILE *inFile)
gdImagePtr gdImageCreateFromBmpPtr(int size,
void *data)
gdImagePtr gdImageCreateFromBmpCtx(gdIOCtxPtr infile)
Close