summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@gnome.org>2006-04-03 23:52:26 +0000
committerJonathon Jongsma <jjongsma@gnome.org>2006-04-03 23:52:26 +0000
commiteb9070f20ea20d2982940e048eb1a0e2032ab026 (patch)
tree4ce1087031c003e7fca3139c716501be7dc01047 /examples
parentc0759862cd5e99e914377e37fc5bcfec0f234efe (diff)
2006-04-03 Jonathon Jongsma <jonathon.jongsma@gmail.com>
* examples/text-rotate/text-rotate.cc: protect PNG functions with #ifdef in case cairo wasn't compiled with PNG support
Diffstat (limited to 'examples')
-rw-r--r--examples/text-rotate/text-rotate.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/text-rotate/text-rotate.cc b/examples/text-rotate/text-rotate.cc
index 3e210fa..9b3bceb 100644
--- a/examples/text-rotate/text-rotate.cc
+++ b/examples/text-rotate/text-rotate.cc
@@ -18,6 +18,7 @@
*/
#include <string>
+#include <iostream>
#include <cairomm/cairomm.h>
// This example is based on the C cairo example of the same name
@@ -83,5 +84,9 @@ int main (void)
Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, WIDTH, HEIGHT);
Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
draw(cr, WIDTH, HEIGHT);
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
surface->write_to_png("text-rotate.png");
+#else
+ std::cout << "You must compile cairo with PNG support for this example to work" << std::endl;
+#endif
}