GdkPixbuf Constructor

GdkPixbuf (GdkColorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height);

Creates an empty image with the desired size.

The colorspace parameter is always Gdk::COLORSPACE_RGB as Gtk itself doesn't support any other. has_alpha defines it the image has opacity (transparency) information for each pixel.

bits_per_sample is the number of bits reserved for each color sample (red/green/blue/alpha). This is normally 8.

Most times you don't want to create an image yourself but use an one existing in a file - use GdkPixbuf::new_from_file then.