// Hello_png.cc // Gloobs example program // // png version of first Gloobs program -- creates a png file, and draws a // square in it // // by Smylers // 2000 Jan 10: original version // 2000 Jan 17: improved comments // include the Gloobs library: #include int main() { // create a PNG Canvas object; this one will have a width of 300_pixels, a // height of 200_pixels, and the filename Hello.png: Gloobs::Canvas DemoPic(Gloobs::PNG, 300, 200, "Hello"); // set the canvas background to colour number 18, which happens to be a // pale blue: DemoPic.set_background(18); // set the pen (drawing colour) to number 19, red: DemoPic.pen(19); // draw a filled rectangle with the bottom-left corner at (100, 50) and the // top-right at (200, 150): DemoPic.filled_rectangle(100, 50, 200, 150); // don't wait for the user to press , because this isn't an X11 // canvas: DemoPic.pause(); return 0; }