BOOL CAboutDlg::OnInitDialog()
{
CDialog::OnInitDialog(); // Create and Initialize the CPictureHolder variable with the
// toolbar resource
CPictureHolder pictholder;
pictholder.CreateFromBitmap(IDR_MAINFRAME); //Pass dispatch pointer to CPictureHolder
m_grid.SetPicture(pictholder.GetPictureDispatch()); // NOTE: GetPictureDispatch() QI()'s for the IPictureDisp
// interface, so the picture object will remain alive until
// the property is reset or the control is destroyed. When
// pictholder goes out of scope, it calls Release() on the
// picture object, but the previously mentioned QI() will have
// bumped the ref count, allowing it to remain alive until the
// control itself releases the picture object. return TRUE;
}
{
CDialog::OnInitDialog(); // Create and Initialize the CPictureHolder variable with the
// toolbar resource
CPictureHolder pictholder;
pictholder.CreateFromBitmap(IDR_MAINFRAME); //Pass dispatch pointer to CPictureHolder
m_grid.SetPicture(pictholder.GetPictureDispatch()); // NOTE: GetPictureDispatch() QI()'s for the IPictureDisp
// interface, so the picture object will remain alive until
// the property is reset or the control is destroyed. When
// pictholder goes out of scope, it calls Release() on the
// picture object, but the previously mentioned QI() will have
// bumped the ref count, allowing it to remain alive until the
// control itself releases the picture object. return TRUE;
}
CPicture pic=m_grid.GetPicture();
pic.GetHandle()返回的是什么?
你要Handle干什么?Render就好啦
有了图象句柄又如何将图像显示出来?
图象类型是BMP时,GetHandle返回HBITMAP