gdiplus graphic problem



  • hallo, ich hab ein problem mit gdi+ graphic objekt. ein paar info zu system

    betriebsystem: windows server 2008 sp1 64bit
    IDE: VS 08 Pro
    windows sdk: v5.0
    gdiplus.dll sind mehrfach unter windows ordner zu finden, version 5.2 und 6 glaub ich
    hier ist der code

    BITMAPINFO bi = {0};
    bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    bi.bmiHeader.biWidth = 1280;
    bi.bmiHeader.biHeight = 1024;
    bi.bmiHeader.biPlanes = 1;
    bi.bmiHeader.biBitCount = 32;
    bi.bmiHeader.biCompression = BI_RGB;
    
    void* pDIBBits = NULL;
    
    HBITMAP hBitmap = ::CreateDIBSection( NULL, &bi, DIB_RGB_COLORS, &pDIBBits, NULL, 0L );
    
    HDC hDC = ::GetDC( NULL );
    HDC hCompatibelDC = ::CreateCompatibleDC( hDC );
    ::SelectObject(hCompatibelDC, hBitmap);
    Gdiplus::Graphics* pGraphics = Gdiplus::Graphics::FromHDC( hCompatibelDC );
    

    Gdiplus::Graphics::FromHDC( hCompatibelDC ) return immer 0, kann mir da jemand weiterhelfen?



  • Wie wäre es den mit CreateCompatibleBitmap()?


Anmelden zum Antworten