diff options
Diffstat (limited to 'src/win32/cdwnative.c')
-rw-r--r-- | src/win32/cdwnative.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/win32/cdwnative.c b/src/win32/cdwnative.c index 69623e1..3534c6e 100644 --- a/src/win32/cdwnative.c +++ b/src/win32/cdwnative.c @@ -44,7 +44,6 @@ static int cdactivate(cdCtxCanvas *ctxcanvas) if (ctxcanvas->hWnd) { RECT rect; - HDC ScreenDC; GetClientRect(ctxcanvas->hWnd, &rect); ctxcanvas->canvas->w = rect.right - rect.left; ctxcanvas->canvas->h = rect.bottom - rect.top; @@ -52,12 +51,7 @@ static int cdactivate(cdCtxCanvas *ctxcanvas) ctxcanvas->canvas->w_mm = ((double)ctxcanvas->canvas->w) / ctxcanvas->canvas->xres; ctxcanvas->canvas->h_mm = ((double)ctxcanvas->canvas->h) / ctxcanvas->canvas->yres; - ScreenDC = GetDC(NULL); - ctxcanvas->canvas->bpp = GetDeviceCaps(ScreenDC, BITSPIXEL); - ReleaseDC(NULL, ScreenDC); - - if (ctxcanvas->canvas->use_matrix) - ctxcanvas->canvas->cxTransform(ctxcanvas, ctxcanvas->canvas->matrix); + ctxcanvas->canvas->bpp = cdGetScreenColorPlanes(); } /* Se nao e' ownwer, tem que restaurar o contexto */ @@ -70,6 +64,9 @@ static int cdactivate(cdCtxCanvas *ctxcanvas) cdwRestoreDC(ctxcanvas); } + if (ctxcanvas->canvas->use_matrix) + ctxcanvas->canvas->cxTransform(ctxcanvas, ctxcanvas->canvas->matrix); + return CD_OK; } |