CG16bitImage *CImageLibrary::GetImage (DWORD dwUNID) // GetImage // // Returns the image by UNID (loading it, if necessary) { // Find the image in the library int iEntry; if (m_Library.LookupEx(dwUNID, &iEntry) != NOERROR) return NULL; CObjectImage *pImage = (CObjectImage *)m_Library.GetValue(iEntry); return pImage->GetImage(); }
CG16bitImage *CDesignCollection::GetImage (DWORD dwUNID, bool bCopy) // GetImage // // Returns an image { CDesignType *pType = m_AllTypes.FindByUNID(dwUNID); if (pType == NULL) return NULL; CObjectImage *pImage = CObjectImage::AsType(pType); if (pImage == NULL) return NULL; if (bCopy) return pImage->CreateCopy(); else return pImage->GetImage(); }
CG32bitImage *CDesignCollection::GetImage (DWORD dwUNID, DWORD dwFlags) // GetImage // // Returns an image { CDesignType *pType = m_AllTypes.FindByUNID(dwUNID); if (pType == NULL) return NULL; CObjectImage *pImage = CObjectImage::AsType(pType); if (pImage == NULL) return NULL; if (dwFlags & FLAG_IMAGE_COPY) return pImage->CreateCopy(); else { CString sError; CG32bitImage *pRawImage = pImage->GetImage(strFromInt(dwUNID), &sError); if (pRawImage == NULL) kernelDebugLogMessage(sError); // Lock, if requested. NOTE: Since we obtained the image above, // this call is guaranteed to succeed. if (dwFlags & FLAG_IMAGE_LOCK) pImage->Lock(SDesignLoadCtx()); // Done return pRawImage; } }