我动态创建了一个静态文本:m_video1.Create(_T(""),WS_CHILD|WS_VISIBLE|SS_NOTIFY | SS_SUNKEN,CRect(x,y,x+720,y+598),this,IDC_DISPLAY);
再得到位图的句柄:
// Find correct resource handle
hInstResource = AfxFindResourceHandle(MAKEINTRESOURCE(IDB_STOP), RT_BITMAP);
// Load bitmap In
m_hLogo = (HBITMAP)::LoadImage(hInstResource, MAKEINTRESOURCE(IDB_STOP), 
IMAGE_BITMAP, 0, 0, 0);
我想用m_video1.SetBitmap(m_hLogo);显示图片,为何显示不了?

解决方案 »

  1.   

    CStatic myStatic;// Create a child bitmap static control.
    myStatic.Create(_T("my static"), 
       WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE, CRect(10,10,150,50), 
       pParentWnd);// Set the bitmap of the static control to be the 
    // system check- bitmap.
    myStatic.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );
      

  2.   

    还是没能显示出来.我想我是没有搞清楚
    // Set the bitmap of the static control to be the 
    // system check- bitmap.还请详解..
      

  3.   

    另外它还有一个错误:error C2065: 'OBM_CHECK' : undeclared identifier
    Error executing cl.exe.
    是不是有哪个头文件没有包含进来?
      

  4.   

    SS_BITMAP   Specifies a bitmap is to be displayed in the static control. The given text is the name of a bitmap (not a filename) defined elsewhere in the resource file. The style ignores the nWidth and nHeight parameters; the control automatically sizes itself to accommodate the bitmap. SS_CENTERIMAGE   Specifies that, if the bitmap or icon is smaller than the client area of the static control, the rest of the client area is filled with the color of the pixel in the top left corner of the bitmap or icon. If the static control contains a single line of text, the text is centered vertically in the client area of the control.