summaryrefslogtreecommitdiff
path: root/src/Fl_Image.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2001-11-23 12:06:36 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2001-11-23 12:06:36 +0000
commit4087b8cd9a139664420468c57489cae73c8b830a (patch)
treee760b9aed14a687ec0e1217676adf43cfe16d889 /src/Fl_Image.cxx
parentf5258404959cff3a299c796676b553b843a94355 (diff)
Add code for PNG and JPEG images.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1713 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Image.cxx')
-rw-r--r--src/Fl_Image.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index b6c61a727..909a2a7d5 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Image.cxx,v 1.5.2.3.2.6 2001/11/22 15:35:01 easysw Exp $"
+// "$Id: Fl_Image.cxx,v 1.5.2.3.2.7 2001/11/23 12:06:36 easysw Exp $"
//
// Image drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -37,6 +37,16 @@ Fl_Image::~Fl_Image() {
}
void Fl_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
+ draw_empty(XP, YP);
+}
+
+void Fl_Image::draw_empty(int X, int Y) {
+ if (w() > 0 && h() > 0) {
+ fl_color(FL_BLACK);
+ fl_rect(X, Y, w(), h());
+ fl_line(X, Y, X + w() - 1, Y + h() - 1);
+ fl_line(X, Y + h() - 1, X + w() - 1, Y);
+ }
}
Fl_Image *Fl_Image::copy(int W, int H) {
@@ -222,6 +232,11 @@ void Fl_RGB_Image::desaturate() {
}
void Fl_RGB_Image::draw(int XP, int YP, int WP, int HP, int cx, int cy) {
+ if (!array) {
+ draw_empty(XP, YP);
+ return;
+ }
+
// account for current clip region (faster on Irix):
int X,Y,W,H; fl_clip_box(XP,YP,WP,HP,X,Y,W,H);
cx += X-XP; cy += Y-YP;
@@ -341,5 +356,5 @@ void Fl_RGB_Image::label(Fl_Menu_Item* m) {
//
-// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.6 2001/11/22 15:35:01 easysw Exp $".
+// End of "$Id: Fl_Image.cxx,v 1.5.2.3.2.7 2001/11/23 12:06:36 easysw Exp $".
//