.\" Generated by the Allegro makedoc utility .TH create_sub_bitmap 3alleg4 "version 4.4.2" "Allegro" "Allegro manual" .SH NAME create_sub_bitmap \- Creates a memory sub bitmap. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B BITMAP *create_sub_bitmap(BITMAP *parent, int x, y, width, height); .SH DESCRIPTION Creates a sub-bitmap, ie. a bitmap sharing drawing memory with a pre-existing bitmap, but possibly with a different size and clipping settings. When creating a sub-bitmap of the mode-X screen, the x position must be a multiple of four. The sub-bitmap width and height can extend beyond the right and bottom edges of the parent (they will be clipped), but the origin point must lie within the parent region. .SH "RETURN VALUE" Returns a pointer to the created sub bitmap, or NULL if the sub bitmap could not be created. Remember to free the sub bitmap before freeing the parent bitmap to avoid memory leaks and potential crashes accessing memory which has been freed. .SH SEE ALSO .BR create_bitmap (3alleg4), .BR create_bitmap_ex (3alleg4), .BR destroy_bitmap (3alleg4), .BR is_sub_bitmap (3alleg4), .BR clear_bitmap (3alleg4), .BR clear_to_color (3alleg4), .BR expat (3alleg4), .BR exscroll (3alleg4), .BR exswitch (3alleg4)