From b39938e5cc0ce645dde8b1a686811fe7e3164a50 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 16 Sep 2006 16:02:00 +0000 Subject: OK, I believe I fixed the transparency issues on WIN32. Please everyone, test the code on all machines. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5436 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Double_Window.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Fl_Double_Window.cxx') diff --git a/src/Fl_Double_Window.cxx b/src/Fl_Double_Window.cxx index 4f87f0bc3..e648fa4ab 100644 --- a/src/Fl_Double_Window.cxx +++ b/src/Fl_Double_Window.cxx @@ -87,7 +87,6 @@ static fl_alpha_blend_func fl_alpha_blend = NULL; * and finds the required function if so. */ char fl_can_do_alpha_blending() { - return 0; static char been_here = 0; static char can_do = 0; if (been_here) return can_do; @@ -111,8 +110,16 @@ HDC fl_makeDC(HBITMAP bitmap) { } void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy) { - static FL_BLENDFUNCTION blendfunc = { 0, 0, 255, 1}; + HDC new_gc = CreateCompatibleDC(fl_gc); + int save = SaveDC(new_gc); + SelectObject(new_gc, bitmap); + BitBlt(fl_gc, x, y, w, h, new_gc, srcx, srcy, SRCCOPY); + RestoreDC(new_gc, save); + DeleteDC(new_gc); +} +void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy) { + static FL_BLENDFUNCTION blendfunc = { 0, 0, 255, 1}; HDC new_gc = CreateCompatibleDC(fl_gc); int save = SaveDC(new_gc); SelectObject(new_gc, bitmap); -- cgit v1.2.3