From 226743a7f1532011e76beb56a15a1bdf95efdc97 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 22 Mar 2009 16:05:29 +0000 Subject: [PATCH] --- src/util/clipboard_win32.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/util/clipboard_win32.h b/src/util/clipboard_win32.h index 2a2f6909f..8964e8105 100644 --- a/src/util/clipboard_win32.h +++ b/src/util/clipboard_win32.h @@ -224,7 +224,23 @@ static void get_win32_clipboard_bitmap(Image*& image, Palette*& palette) break; } case 16: { - // TODO + // TODO I am not sure if this really works + ase_uint8* src = (((ase_uint8*)bi)+bi->bmiHeader.biSize); + ase_uint8 b1, b2, r, g, b; + int padding = (4-(image->w*2)&3)&3; + + for (int y=image->h-1; y>=0; --y) { + for (int x=0; xw; ++x) { + b1 = *(src++); + b2 = *(src++); + b = _rgb_scale_5[((b1 & 0xf800) >> 11)]; + g = _rgb_scale_6[((b2 & 0x07e0) >> 5)]; + r = _rgb_scale_5[(b2 & 0x001f)]; + image->method->putpixel(image, x, y, _rgba(r, g, b, 255)); + } + src += padding; + } + valid_image = true; break; } case 8: {