SysTryReturnResult(NID_UI_ANIM, (pCanvas), E_SYSTEM, "A system error has been occurred. Failed to get canvas.");
currentBounds.SetPosition(0, 0);
- _VisualElementImpl::GetInstance(*__pCurrentFormVisualElement)->Capture(*pCanvas, currentBounds, true);
+ _VisualElementImpl::GetInstance(*__pCurrentFormVisualElement)->Capture(*pCanvas, currentBounds, currentBounds, true);
delete pCanvas;
pCanvas = __pNextCaptureVisualElement->GetCanvasN();
SysTryReturnResult(NID_UI_ANIM, (pCanvas), E_SYSTEM, "A system error has been occurred. Failed to get canvas.");
nextBounds.SetPosition(0, 0);
- _VisualElementImpl::GetInstance(*__pNextFormVisualElement)->Capture(*pCanvas, nextBounds, true);
+ _VisualElementImpl::GetInstance(*__pNextFormVisualElement)->Capture(*pCanvas, nextBounds, nextBounds, true);
delete pCanvas;
return E_SUCCESS;
return FloatPoint3(x, y, z);
}
+/*
+ * VE ------------------------------------- surface
+ * <----40---> <------- 80 ------->
+ * +---------+ +------------------+
+ * | | scaleX = 2.0f | (pStart) |
+ * +---------+ +------------------+
+ * when capture (0,0,20,20)
+ * pCopy: width = 20 * scaleX = 40
+ * +---------+
+ * | pCopy |
+ * +---------+
+ */
+
+
result
_VisualElementImpl::CaptureI(Canvas& outputCanvas, const FloatRectangle& rectDest, _VisualElementImpl& reference, const FloatRectangle& rectRef, const FloatRectangle& clipRect, bool withChilren, int depth)
{
}
#else
- if (__pSharedData->pSurface)
+ if (__pSharedData->pSurface )
{
_EflVisualElementSurfaceImpl* pSurfImpl = dynamic_cast<_EflVisualElementSurfaceImpl*>(_VisualElementSurfaceImpl::GetInstance(*__pSharedData->pSurface));
- if(pSurfImpl && pSurfImpl->GetNativeHandle() )
+ bool validContentsBounds = true;
+
+ if(__useContentBounds)
+ {
+ if(__contentBounds.x < 0.0f || __contentBounds.y < 0.0f || __contentBounds.width > 1.0f || __contentBounds.height > 1.0f )
+ {
+ validContentsBounds = false;
+ }
+ }
+
+ if(likely(validContentsBounds) && pSurfImpl && pSurfImpl->GetNativeHandle() )
{
BufferInfo info;
byte* pStart = null;
if(pStart)
{
- _VisualElementCoordinateSystem::ConvertRectangleToPhysicalIntegral(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
+ float scaleX = 1.0f;
+ float scaleY = 1.0f;
+
+ if(!__useContentBounds)
+ {
+ scaleX = (float)info.width/(float)__bounds.width;
+ scaleY = (float)info.height/(float)__bounds.height;
+ }
+ else
+ {
+ scaleX = ((float)info.width * __contentBounds.width)/(float)__bounds.width;
+ scaleY = ((float)info.height * __contentBounds.height)/(float)__bounds.height;
+ }
+
+
+// _VisualElementCoordinateSystem::ConvertRectangleToPhysicalIntegral(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
BufferInfo copyInfo;
copyInfo.bitsPerPixel = info.bitsPerPixel;
- copyInfo.width = drawRect.width;
- copyInfo.height = drawRect.height;
+ copyInfo.width = drawRect.width*scaleX;
+ copyInfo.height = drawRect.height*scaleY;
copyInfo.pitch = (info.pitch/info.width)*copyInfo.width;
byte* pCopy = new (std::nothrow) byte[copyInfo.height*(copyInfo.pitch)];
if (pCopy)
{
- //memcpy(pCopy, pStart, info.height*(info.pitch));
-
+ pStart += info.pitch * int(drawRect.y*scaleY) + int(drawRect.x*scaleX) * info.bitsPerPixel/8;
for (int y = 0; y < copyInfo.height; y++)
{
- unsigned int* pSrc = (unsigned int*)((unsigned char*)pStart + info.pitch * (y + int(drawRect.y)) + int(drawRect.x) * 4);
- unsigned int* pAddr = (unsigned int*)((unsigned char*)pCopy + copyInfo.pitch * y);
+ unsigned int* pSrc = (unsigned int*)(pStart + info.pitch * y);
+ unsigned int* pAddr = (unsigned int*)(pCopy + copyInfo.pitch * y);
for (int x = 0; x < copyInfo.width; x++)
{
int a = ((*pSrc) >> 24) & 0xff;
b = b / fa;
*pAddr = (a << 24) | (r << 16) | (g << 8) | b;
}
+ else
+ {
+ *pAddr = 0;
+ }
pSrc++;
pAddr++;
}
}
- _VisualElementCoordinateSystem::ConvertRectangleToLogical(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
+// _VisualElementCoordinateSystem::ConvertRectangleToLogical(drawRect.x, drawRect.y, drawRect.width, drawRect.height);
ByteBuffer buffer;
{
_BitmapImpl::GetInstance(*pBitmap)->SetAsPremultiplied();
pBitmap->SetAlphaConstant((int)(pRenderTarget->GetOpacityFromRoot() * 255.0f));
+ if(!_FloatCompare(scaleX , 1.0f) && !_FloatCompare(scaleY,1.0f))
+ {
+ pBitmap->Scale(FloatDimension(drawRect.width,drawRect.height));
+ }
FloatRectangle outputRect(rectDest.x + bounds.x - rectRef.x, rectDest.y + bounds.y - rectRef.y, drawRect.width, drawRect.height);
FloatRectangle srcRect = outputRect;
Bitmap* pBitmap = Bitmap::GetNonScaledBitmapN(buffer, Dimension(info.width, info.height), BITMAP_PIXEL_FORMAT_ARGB8888);
if (pBitmap)
{
+ pBitmap->Scale(FloatDimension(__bounds.width,__bounds.height));
_BitmapImpl::GetInstance(*pBitmap)->SetAsPremultiplied();
pBitmap->SetAlphaConstant((int)(pRenderTarget->GetOpacityFromRoot() * 255.0f));