diff options
Diffstat (limited to 'vncviewer/Surface_Win32.cxx')
-rw-r--r-- | vncviewer/Surface_Win32.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/vncviewer/Surface_Win32.cxx b/vncviewer/Surface_Win32.cxx index 5a9a6546..5eea2d1d 100644 --- a/vncviewer/Surface_Win32.cxx +++ b/vncviewer/Surface_Win32.cxx @@ -70,6 +70,25 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h) DeleteDC(dc); } +void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h) +{ + HDC origdc, dstdc; + + dstdc = CreateCompatibleDC(NULL); + if (!dstdc) + throw rdr::SystemException("CreateCompatibleDC", GetLastError()); + + if (!SelectObject(dstdc, dst->bitmap)) + throw rdr::SystemException("SelectObject", GetLastError()); + + origdc = fl_gc; + fl_gc = dstdc; + draw(src_x, src_y, x, y, w, h); + fl_gc = origdc; + + DeleteDC(dstdc); +} + void Surface::alloc() { BITMAPINFOHEADER bih; |