The desired Format of an image surface to be created
The desired width of an image surface to be created
the appropriate stride to use given the desired format and width, or -1 if either the format is invalid or the width too large.
int stride; ubyte[] data; Surface surface; stride = formatStrideForWidth(format, width); data = new ubyte[](stride * height); //could also use malloc surface = new ImageSurface(data, format, width, height, stride);
This function provides a stride value that will respect all alignment requirements of the accelerated image-rendering code within cairo.