Hi All,
I am working with COSMCtrl in order to display maps on to the viewing window.
In the COSMCtrl, a file name is passed on to the CD2DBitmap constructor along with CRenderTarget object. But my application doesnt have image file. It will receive image data (in the form of byte array) from a database.
Could any one please help me in finding out the solution ?
The sample code is below:
BOOL COSMCtrl::DrawTile(CRenderTarget* pRenderTarget, const CD2DRectF& rTile, int nTileX, int nTileY)
{
BOOL bSuccess = FALSE;
int nZoom = static_cast<int>(m_fZoom);
CString sFile(GetTileCachePath(m_sCacheDirectory, nZoom, nTileX, nTileY, FALSE));
double fInt = 0;
double fFractionalZoom = modf(m_fZoom, &fInt);
CD2DBitmap bitmap(pRenderTarget, sFile);
BOOL bStandardTile = FALSE;
if (fFractionalZoom == 0 && SUCCEEDED(bitmap.Create(pRenderTarget)))
bStandardTile = TRUE;
if (bStandardTile)
{
pRenderTarget->DrawBitmap(&bitmap, rTile, 1.0);
bSuccess = TRUE;
}
return bSuccess;
}
1. I am not allowed to save the byte array to disk (as image).
2. I have tried using the other constructor of CD2DBitmap which accepts CRenderTarget and HBITMAP. but of no use