Help! How can I draw a bitmap only with BITMAP information!

Discussion in 'C++' started by xqggz, Jun 19, 2007.

  1. xqggz

    xqggz Guest

    HI everyone,
    Now I have only the information of the BITMAP , but not an actual
    bitmap. I want to draw the bitmap according the BITMAP struction
    information, what can I do? I use the VC2005 Express and I am not
    familliar with the SDK function? I searched on the web site and got an
    example as following, but it need load an actual bitmap resource. Now
    I have only the bm:
    case WM_PAINT:
    {
    BITMAP bm;
    PAINTSTRUCT ps;

    HDC hdc = BeginPaint(hwnd, &ps);

    HDC hdcMem = CreateCompatibleDC(hdc);
    HBITMAP hbmOld = SelectObject(hdcMem, g_hbmBall);

    GetObject(g_hbmBall, sizeof(bm), &bm);

    BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0,
    SRCCOPY);

    SelectObject(hdcMem, hbmOld);
    DeleteDC(hdcMem);

    EndPaint(hwnd, &ps);
    }
    break;
    Could anybody help me??? Thanks!!!
     
    xqggz, Jun 19, 2007
    #1
    1. Advertising

  2. xqggz wrote:
    > Now I have only the information of the BITMAP , but not an actual
    > bitmap. I want to draw the bitmap according the BITMAP struction
    > information, what can I do? [..]


    This is not a C++ language question. Please ask in the newsgroup
    dedicated to MS Windows programming. See FAQ for the list of the
    suggested newsgroups.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jun 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gandalf

    Masked bitmap from bitmap

    Gandalf, Jan 29, 2004, in forum: Python
    Replies:
    0
    Views:
    591
    Gandalf
    Jan 29, 2004
  2. pythonprogrammer
    Replies:
    1
    Views:
    478
    Srini
    Sep 5, 2005
  3. Mukt
    Replies:
    2
    Views:
    868
    Andrew Thompson
    Aug 16, 2007
  4. Lew
    Replies:
    1
    Views:
    401
    Roedy Green
    Aug 17, 2007
  5. fancyerii
    Replies:
    7
    Views:
    850
    Knute Johnson
    Aug 3, 2008
Loading...

Share This Page