summaryrefslogtreecommitdiff
path: root/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-10-22 11:42:20 +0000
committerManolo Gouy <Manolo>2016-10-22 11:42:20 +0000
commitbbfd91977309465464a318e69dfad2bbfbc5df5a (patch)
treecd24598c8f0e1b505d469b08658c0e48fd259ef7 /src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
parent52479a5ef156ec7bf4ed1661bf5fd6ac5f04b98f (diff)
WIN platform: implement Fl_GDI_Graphics_Driver::draw_scaled(Fl_Image *img,int,int,int,int) when img is a Fl_RGB_Image
Implementation uses StretchBlt() when img->d() is 1 or 3 and AlphaBlend() when it is 2 or 4. This should turn useful to draw images on HighDPI displays using the display's true resolution. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12053 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
index e10191ec2..1ba2a198a 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.cxx
@@ -113,6 +113,10 @@ void Fl_GDI_Graphics_Driver::copy_offscreen(int x,int y,int w,int h,HBITMAP bitm
DeleteDC(new_gc);
}
+BOOL Fl_GDI_Graphics_Driver::alpha_blend_(int x, int y, int w, int h, HDC src_gc, int srcx, int srcy, int srcw, int srch) {
+ return fl_alpha_blend(gc_, x, y, w, h, src_gc, srcx, srcy, srcw, srch, blendfunc);
+}
+
#if ! defined(FL_DOXYGEN)
void Fl_GDI_Graphics_Driver::copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP bitmap,int srcx,int srcy) {
HDC new_gc = CreateCompatibleDC(gc_);
@@ -121,7 +125,7 @@ void Fl_GDI_Graphics_Driver::copy_offscreen_with_alpha(int x,int y,int w,int h,H
BOOL alpha_ok = 0;
// first try to alpha blend
if ( can_do_alpha_blending() ) {
- alpha_ok = fl_alpha_blend(gc_, x, y, w, h, new_gc, srcx, srcy, w, h, blendfunc);
+ alpha_ok = alpha_blend_(x, y, w, h, new_gc, srcx, srcy, w, h);
}
// if that failed (it shouldn't), still copy the bitmap over, but now alpha is 1
if (!alpha_ok) {