diff options
Diffstat (limited to 'src/ps_image.cxx')
| -rw-r--r-- | src/ps_image.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ps_image.cxx b/src/ps_image.cxx index 3939a7511..ca71121b9 100644 --- a/src/ps_image.cxx +++ b/src/ps_image.cxx @@ -602,6 +602,32 @@ void Fl_PostScript_Graphics_Driver::draw(Fl_RGB_Image * rgb,int XP, int YP, int mask=0; } +int Fl_PostScript_Graphics_Driver::draw_scaled(Fl_RGB_Image *rgb, int XP, int YP, int WP, int HP){ + int X, Y, W, H; + clip_box(XP,YP,WP,HP,X,Y,W,H); // X,Y,W,H will give the unclipped area of XP,YP,WP,HP + if (W == 0 || H == 0) return 1; + push_no_clip(); // remove the FLTK clip that can't be rescaled + clocale_printf("%d %d %i %i CL\n", X, Y, W, H); + clocale_printf("GS %d %d TR %f %f SC GS\n", XP, YP, float(WP)/rgb->w(), float(HP)/rgb->h()); + draw(rgb, 0, 0, rgb->w(), rgb->h(), 0, 0); + clocale_printf("GR GR\n"); + pop_clip(); // restore FLTK's clip + return 1; +} + +int Fl_PostScript_Graphics_Driver::draw_scaled(Fl_Pixmap *img, int XP, int YP, int WP, int HP){ + int X, Y, W, H; + clip_box(XP,YP,WP,HP,X,Y,W,H); // X,Y,W,H will give the unclipped area of XP,YP,WP,HP + if (W == 0 || H == 0) return 1; + push_no_clip(); // remove the FLTK clip that can't be rescaled + clocale_printf("%d %d %i %i CL\n", X, Y, W, H); + clocale_printf("GS %d %d TR %f %f SC GS\n", XP, YP, float(WP)/img->w(), float(HP)/img->h()); + draw(img, 0, 0, img->w(), img->h(), 0, 0); + clocale_printf("GR GR\n"); + pop_clip(); // restore FLTK's clip + return 1; +} + void Fl_PostScript_Graphics_Driver::draw(Fl_Bitmap * bitmap,int XP, int YP, int WP, int HP, int cx, int cy){ const uchar * di = bitmap->array; int w,h; |
