CAImageView* CAWebViewImpl::getWebViewImage() { getWebViewImageJNI(_viewTag); if (!s_cszWebViewImageData.empty()) { DSize size = _webView->getBounds().size; CAImage* pImage = new CAImage(); if (!pImage->initWithRawData((const unsigned char*)&s_cszWebViewImageData[0], CAImage::PixelFormat_RGBA8888, size.width, size.height)) { delete pImage; return NULL; } pImage->autorelease(); return CAImageView::createWithImage(pImage); } return NULL; }
CAImageView* CAWebViewImpl::getWebViewImage() { getWebViewImageJNI(_viewTag); if (!s_cszWebViewImageData.empty()) { CCSize size = _webView->getBounds().size; CAImage* pImage = new CAImage(); if (!pImage->initWithImageData((const unsigned char*)&s_cszWebViewImageData[0], s_cszWebViewImageData.size())) { delete pImage; return NULL; } pImage->autorelease(); return CAImageView::createWithImage(pImage); } return NULL; }