diff options
| author | Manolo Gouy <Manolo> | 2010-03-16 12:03:48 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2010-03-16 12:03:48 +0000 |
| commit | b20ef0bdeb4f9b98d67c189005c98cbed2b6ebb6 (patch) | |
| tree | 07468aff136b0e503200c0960424f9b42e0f8a79 | |
| parent | 0df1d8b6958f5f6639ddb5d41d5ceef235ccae01 (diff) | |
Fixed WIN32 printing of RGB images without transparency. Still print_window_part() problem.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7275 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/fl_draw_image_win32.cxx | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/fl_draw_image_win32.cxx b/src/fl_draw_image_win32.cxx index e735dcaa0..82dcc5ee4 100644 --- a/src/fl_draw_image_win32.cxx +++ b/src/fl_draw_image_win32.cxx @@ -49,7 +49,8 @@ #include <FL/fl_draw.H> #include <FL/x.H> -#define MAXBUFFER 0x40000 // 256k +//#define MAXBUFFER 0x40000 // 256k +#define MAXBUFFER 0x100000 // 1024k #if USE_COLORMAP @@ -254,6 +255,22 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, } } } + if(Fl_Device::current()->type() == Fl_Device::gdi_printer) { + // if print context, device and logical units are not equal, so SetDIBitsToDevice + // does not do the expected job, whereas StretchDIBits does it. + // TODO with Fl_Printer::print_window_part(), StretchDIBits does not work well + // with large captures whereas SetDIBitsToDevice does. + StretchDIBits(fl_gc, x, y+j-k, w, k, 0, 0, w, k, + (LPSTR)((uchar*)buffer+(blocking-k)*linesize), + &bmi, +#if USE_COLORMAP + indexed ? DIB_PAL_COLORS : DIB_RGB_COLORS +#else + DIB_RGB_COLORS +#endif + , SRCCOPY ); + } + else { SetDIBitsToDevice(fl_gc, x, y+j-k, w, k, 0, 0, 0, k, (LPSTR)((uchar*)buffer+(blocking-k)*linesize), &bmi, @@ -263,6 +280,7 @@ static void innards(const uchar *buf, int X, int Y, int W, int H, DIB_RGB_COLORS #endif ); + } } } |
