diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-24 18:07:58 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2001-11-24 18:07:58 +0000 |
| commit | b650366d80e58cf3154c5bdf8ceb6a242c1a0251 (patch) | |
| tree | c71ef9770b24f56c44495006426739adfa89c99e /test/image.cxx | |
| parent | e016a249b25c77b38d77d3a26d563cdec7a2592b (diff) | |
Added XBM, XPM, and PNM image file classes.
The pixmap_browser demo now supports all image formats via Fl_Shared_Image.
Dropped image file stuff from image demo.
Added Fl_Tiled_Image class, which tiles an Fl_Image, useful for tiling a
background image in groups.
Added tiled_image demo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1725 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/image.cxx')
| -rw-r--r-- | test/image.cxx | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/test/image.cxx b/test/image.cxx index 31205eb00..3a7baebbe 100644 --- a/test/image.cxx +++ b/test/image.cxx @@ -1,5 +1,5 @@ // -// "$Id: image.cxx,v 1.6.2.3.2.4 2001/11/24 02:46:19 easysw Exp $" +// "$Id: image.cxx,v 1.6.2.3.2.5 2001/11/24 18:07:57 easysw Exp $" // // Fl_Image test program for the Fast Light Tool Kit (FLTK). // @@ -30,7 +30,7 @@ #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Button.H> -#include <FL/Fl_Shared_Image.H> +#include <FL/Fl_Image.H> #include <stdio.h> #include <stdlib.h> #include <math.h> @@ -96,9 +96,9 @@ int arg(int argc, char **argv, int &i) { } int main(int argc, char **argv) { +#ifndef WIN32 int i = 1; -#ifndef WIN32 Fl::args(argc,argv,i,arg); if (visid >= 0) { @@ -123,21 +123,11 @@ int main(int argc, char **argv) { window.color(FL_WHITE); Fl_Button b(140,160,120,120,"Image w/Alpha"); ::b = &b; - Fl_Image *rgb; + Fl_RGB_Image *rgb; Fl_Image *dergb; - if (argv[1]) { - rgb = Fl_Shared_Image::get(argv[1]); - if (rgb->w() > 100 || rgb->h() > 100) { - if (rgb->w() > rgb->h()) rgb = rgb->copy(100, 100 * rgb->h() / rgb->w()); - else rgb = rgb->copy(100 * rgb->w() / rgb->h(), 100); - } - b.label(argv[1]); - } else { - make_image(); - rgb = new Fl_RGB_Image(image, width, height,4); - } - + make_image(); + rgb = new Fl_RGB_Image(image, width, height,4); dergb = rgb->copy(); dergb->inactive(); @@ -165,5 +155,5 @@ int main(int argc, char **argv) { } // -// End of "$Id: image.cxx,v 1.6.2.3.2.4 2001/11/24 02:46:19 easysw Exp $". +// End of "$Id: image.cxx,v 1.6.2.3.2.5 2001/11/24 18:07:57 easysw Exp $". // |
