LoadImage(szFileName, IMAGE_BITMAP, x, y, LR_LOADFROMFILE);

解决方案 »

  1.   


    Set Picture1.Picture = LoadPicture("filename")
      

  2.   

    CStatic m_LOGOPICTURE;
    m_LOGOPICTURE.SetBitmap(::LoadBitmap(NULL,"Forset.bmp"));
    m_LOGOPICTURE.ShowWindow(SW_SHOW);
    没有反应,请继续指点
      

  3.   

    shit!
    告诉你了用LoadImage(szFileName, IMAGE_BITMAP, x, y, LR_LOADFROMFILE);CStatic m_LOGOPICTURE;
    m_LOGOPICTURE.SetBitmap(LoadImage("Forset.bmp", IMAGE_BITMAP, x, y, LR_LOADFROMFILE));
    m_LOGOPICTURE.ShowWindow(SW_SHOW);
      

  4.   

    大哥,报错了。如下:
    error C2660: 'LoadImageA' : function does not take 5 parameters
      

  5.   

    改为:
    CStatic m_LOGOPICTURE;
    m_LOGOPICTURE.SetBitmap( NULL,LoadImage("Forset.bmp", IMAGE_BITMAP, x, y, LR_LOADFROMFILE));
    m_LOGOPICTURE.ShowWindow(SW_SHOW); 
    SetBitmap的参数又不对了,大虾们请了请了
      

  6.   

    LoadImage
    The LoadImage function loads an icon, cursor, or bitmap.HANDLE LoadImage(
      HINSTANCE hinst,   // handle of the instance containing the image
      LPCTSTR lpszName,  // name or identifier of image
      UINT uType,        // type of image
      int cxDesired,     // desired width
      int cyDesired,     // desired height
      UINT fuLoad        // load flags
    );LR_LOADFROMFILE Loads the image from the file specified by the lpszName parameter. If this flag is not specified, lpszName is the name of the resource 
     
      

  7.   

    改为:
    CStatic m_LOGOPICTURE;
    m_LOGOPICTURE.SetBitmap( NULL,LoadImage(NULL,"Forset.bmp", IMAGE_BITMAP, x, y, LR_LOADFROMFILE));
    m_LOGOPICTURE.ShowWindow(SW_SHOW); 
      

  8.   

    给你一个原代码:void CDialog8View::DispBmp(CString FileName,CDC *pDC)
    {
    CFile  file;
    if(!file.Open(FileName,CFile::modeRead|CFile::shareDenyNone))
    return; WORD bfType;
    DWORD bfSize;
    file.Read(&bfType,sizeof(WORD));
    file.Read(&bfSize,sizeof(DWORD));
    file.Seek(2*sizeof(WORD),CFile::current);
    DWORD bf0fBits;
    file.Read(&bf0fBits,sizeof(DWORD));
    int size=bf0fBits-14;
    LPBITMAPINFO lpbitmapinfo;
    lpbitmapinfo=(LPBITMAPINFO) new BYTE[size];
    file.Seek(14,CFile::begin);
    file.ReadHuge(lpbitmapinfo,size);
    LPVOID pbitsrc;
    pbitsrc=(LPVOID) new char[bfSize-bf0fBits];
    if(pbitsrc==NULL)
    {
    delete lpbitmapinfo;
    return;
    }
    file.ReadHuge(pbitsrc,bfSize-bf0fBits);
    file.Close(); CRect arry;
    GetClientRect(&arry);
    HDRAWDIB hdd= ::DrawDibOpen();
    ::DrawDibBegin(hdd,pDC->m_hDC,lpbitmapinfo->bmiHeader.biWidth,
    lpbitmapinfo->bmiHeader.biHeight,&lpbitmapinfo->bmiHeader,
    lpbitmapinfo->bmiHeader.biWidth,
    lpbitmapinfo->bmiHeader.biHeight,DDF_ANIMATE); ::DrawDibDraw(hdd,pDC->m_hDC,
    10,//(arry.right - lpbitmapinfo->bmiHeader.biWidth)/2,
    10,//(arry.bottom - lpbitmapinfo->bmiHeader.biHeight)/2,
    lpbitmapinfo->bmiHeader.biWidth,
    lpbitmapinfo->bmiHeader.biHeight,
    &lpbitmapinfo->bmiHeader,
    pbitsrc,0,0,
    lpbitmapinfo->bmiHeader.biWidth,
    lpbitmapinfo->bmiHeader.biHeight,
    DDF_SAME_DRAW|DDF_SAME_HDC); ::DrawDibClose(hdd);
    delete lpbitmapinfo;
    delete pbitsrc;
    }
      

  9.   

    我KAO,就这么点事还讨论这多?
      

  10.   

    hujun614(胡均):
    CStatic::SetBitmap
    HBITMAP SetBitmap( HBITMAP hBitmap );
    参数不对呀
      

  11.   

    各位大佬,不是要显示一副bmp图,而是将一个bmp图与PICTURE控件绑定,这样需要的时候,仅仅显示picture控件即可