载入 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 );
http://jp.njuct.edu.cn/information/icon piker.exe要源代码话 , [email protected]
http://jp.njuct.edu.cn/information/icon picker.exe
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
);