Esempio n. 1
0
void LKMaskBitmapSurface::Create(const LKSurface& Surface, unsigned width, unsigned height) {
#ifdef USE_GDI
    Attach(::CreateCompatibleDC(Surface.GetAttribDC()));
    SetAttribDC(Surface.GetAttribDC());

    _hBitmap = LKBitmap(::CreateBitmap(width, height, 1, 1, NULL));
    _oldBitmap = LKBitmap((HBITMAP)::SelectObject(_OutputDC, _hBitmap));
#else 
    LKBitmapSurface::Create(Surface, width, height);
#endif
}
Esempio n. 2
0
void LKBitmapSurface::Create(const LKSurface& Surface, unsigned width, unsigned height) {
#ifdef USE_GDI
    Attach(::CreateCompatibleDC(Surface.GetAttribDC()));
    SetAttribDC(Surface.GetAttribDC());

    _Size = { (LONG)width, (LONG)height };
    _hBitmap = LKBitmap (::CreateCompatibleBitmap(GetAttribDC(), width, height));
    _oldBitmap = LKBitmap((HBITMAP)::SelectObject(_OutputDC, _hBitmap));
#else
    _pCanvas = new BufferCanvas(Surface, {width, height});
#endif    
}