mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 03:15:21 +08:00
Removed duplicated code when printing pixmap on WIN32.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9291 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
+1
-9
@@ -141,22 +141,14 @@ void Fl_GDI_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP
|
|||||||
if(hMod) fl_TransparentBlt = (fl_transp_func)GetProcAddress(hMod, "TransparentBlt");
|
if(hMod) fl_TransparentBlt = (fl_transp_func)GetProcAddress(hMod, "TransparentBlt");
|
||||||
}
|
}
|
||||||
if (fl_TransparentBlt) {
|
if (fl_TransparentBlt) {
|
||||||
Fl_Offscreen tmp_id = fl_create_offscreen(pxm->w(), pxm->h());
|
|
||||||
fl_begin_offscreen(tmp_id);
|
|
||||||
uchar *bitmap = 0;
|
|
||||||
fl_mask_bitmap = &bitmap;
|
|
||||||
// draw pixmap to offscreen
|
|
||||||
fl_draw_pixmap(pxm->data(), 0, 0);
|
|
||||||
fl_end_offscreen();
|
|
||||||
HDC new_gc = CreateCompatibleDC(fl_gc);
|
HDC new_gc = CreateCompatibleDC(fl_gc);
|
||||||
int save = SaveDC(new_gc);
|
int save = SaveDC(new_gc);
|
||||||
SelectObject(new_gc, (void*)tmp_id);
|
SelectObject(new_gc, (void*)pxm->id_);
|
||||||
// print all of offscreen but its parts in background color
|
// print all of offscreen but its parts in background color
|
||||||
extern UINT win_pixmap_bg_color; // computed by fl_draw_pixmap()
|
extern UINT win_pixmap_bg_color; // computed by fl_draw_pixmap()
|
||||||
fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, pxm->w(), pxm->h(), win_pixmap_bg_color );
|
fl_TransparentBlt(fl_gc, X, Y, W, H, new_gc, cx, cy, pxm->w(), pxm->h(), win_pixmap_bg_color );
|
||||||
RestoreDC(new_gc,save);
|
RestoreDC(new_gc,save);
|
||||||
DeleteDC(new_gc);
|
DeleteDC(new_gc);
|
||||||
fl_delete_offscreen(tmp_id);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)pxm->id_, cx, cy);
|
fl_copy_offscreen(X, Y, W, H, (Fl_Offscreen)pxm->id_, cx, cy);
|
||||||
|
|||||||
Reference in New Issue
Block a user