// // Simple example of how to use an SVG image in an FLTK program. // Assumes fltk was built with --enable-nanosvg. // // Copyright 1998-2010 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // // https://www.fltk.org/COPYING.php // // Please see the following page on how to report bugs and issues: // // https://www.fltk.org/bugs.php // #include /* needed only to detect FLTK_USE_SVG */ #include #include #include #include #include #include /* svg logo */ const char *svg_logo = "\n" "\n" "\n" "\n" "\n" "\n"; int main(int argc, char **argv) { #ifndef FLTK_USE_SVG fl_message("You need to build FLTK with 'configure --enable-svg'\n" "or CMake option 'FLTK_OPTION_SVG'\n" "to use this example."); return(1); #else Fl_SVG_Image *svg = new Fl_SVG_Image(NULL, svg_logo); Fl_Window *win = new Fl_Window(720, 486, "howto-simple-svg"); Fl_Box *box = new Fl_Box(10,10,720-20,486-20); box->image(svg); win->end(); win->show(argc,argv); return(Fl::run()); #endif }