surface_save_part(id,fname,x,y,w,h)

From ENIGMA
Jump to navigation Jump to search

Description

Saves a cropped area of the given surface to a file.

Parameters

Parameter Data Type Description
id integer index of the surface
fname string file name or path where to save it
x unsigned x coordinate of the top left corner of the area to save
y unsigned y coordinate
w unsigned width of the area to save
h unsigned height of the area

Return Values

void: This function does not return anything.

Example Call

// demonstrates saving the top left 5x5 pixel area of a surface as a portable network graphics relative to the working directory
surface_save_part(surf, "surf.png", 0, 0, 5, 5);