得到icon的尺寸,颜色数量等信息,其实就是得到BITMAPINFOHEADER,再自己创建一个ICON/CURSOR directory,对应于BITMAPFILEHEADER,后面是BITMAPINFOHEADER和颜色表

解决方案 »

  1.   

    俺大一时候写的:
    http://jp.njuct.edu.cn/information/icon piker.exe要源代码话 , [email protected]
      

  2.   

    错了,是
    http://jp.njuct.edu.cn/information/icon picker.exe
      

  3.   

    载入
    BOOL bResult=FALSE;
    if(hIcon){
    PICTDESC desc;
    desc.cbSizeofstruct = sizeof(PICTDESC);
    desc.picType = PICTYPE_ICON;
    desc.icon.hicon= hIcon;
    if(FAILED(::OleCreatePictureIndirect(&desc,IID_IPicture,FALSE,(LPVOID*)&m_IPicture))){//IPicture* m_IPicture
    bResult=FALSE;
    }
    else{
    bResult=TRUE;
    }
    }
    DestroyIcon(hIcon);
    保存(我还没做)IPicture::SaveAsFile
    Saves the picture's data into a stream in the same format that it would save itself into a file. Bitmaps use the BMP file format, metafiles the WMF format, and icons the ICO format. For more information, see the Platform SDK.HRESULT SaveAsFile(
      IStream * pstream,
                     //Pointer to stream where picture writes its data
      BOOL fSaveMemCopy ,
                     //Indicates whether to save the picture in memory
      LONG* pcbSize  //Receives a pointer to the number of bytes written 
                     //to stream
    );