}
}
}
+// if (pArgs != null)
+// {
+// __sourceFilePath = *(static_cast<String*>(pArgs->GetAt(0)));
+// __cropMode = *(static_cast<String*>(pArgs->GetAt(1)));
+// delete pArgs;
+// }
+// else
+// {
+// __sourceFilePath = __pPresentationModel->GetFilePathAt(0);
+// }
+/* if (__sourceFilePath.IsEmpty() == false && __cropMode.IsEmpty() == false)
+ {
+ __cropMode.ToLowerCase();
+ result r = __imageBuffer.Construct(__sourceFilePath.GetPointer());
+ if (r == E_SUCCESS)
+ {
+ __imageWidth = __imageBuffer.GetWidth();
+ __imageHeight = __imageBuffer.GetHeight();
+ __pCurrentBitmap = __imageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_RGB565, BUFFER_SCALING_AUTO);
+ }
+ Image img;
+ __imageFormat = img.GetImageFormat(__sourceFilePath);
+ }*/
+ SetValue();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
}
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
pList->Add(new (std::nothrow) String(destFilePath));
+ AppLog("Manish %ls", destFilePath.GetPointer());
pSceneManager->GoBackward(BackwardSceneTransition(), pList);
}
else if(__cropMode == "fit-to-screen")
{
+ AppLog("Manish OnActionPerformed");
ImageBuffer* pCropBuffer = null;
result r = E_SUCCESS;
pCropBuffer = __imageBuffer.CropN(((__cropBox.x - __imageBox.x) * __imageWidth) / __imageBox.width, ((__cropBox.y - __imageBox.y) * __imageHeight) / __imageBox.height,
}
else if (__statusValue == SET_AT_TYPE_CALLER_IMAGE)
{
- int count = 1;
- int index = 0;
- String destFilePath;
- String stringToInsert = L"_";
- String delimiter = L".";
- if (__sourceFilePath.IsEmpty() == false)
- {
- __sourceFilePath.Reverse();
- __sourceFilePath.IndexOf(delimiter, 0, index);
- __sourceFilePath.Reverse();
- __sourceFilePath.Insert(stringToInsert, __sourceFilePath.GetLength() - index - 1);
- destFilePath.Append(__sourceFilePath);
- destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
- while (File::IsFileExist(destFilePath) == true)
- {
- count++;
- destFilePath.Clear();
- destFilePath.Append(__sourceFilePath);
- destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
- }
- }
- r = pCropBuffer->EncodeToFile(destFilePath, __imageFormat, true, 100);
- ContentManager::ScanFile(destFilePath);
Contact* pContact = null;
AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
Addressbook* pAddressbook = null;
pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
pContact = pAddressbook->GetContactN(__contentId);
- pContact->SetThumbnail(destFilePath);
+ pContact->SetThumbnail(__sourceFilePath);
pAddressbook->UpdateContact(*pContact);
delete pContact;
}
else if (__cropMode != "auto")
{
+ //AppLog("Manish Fit to screen");
if (__pointLocation == INSIDE_LEFT_RECTANGLE || __pointLocation == INSIDE_BOTTOM_LEFT_RECTANGLE
|| __pointLocation == INSIDE_TOP_LEFT_RECTANGLE)
{
&& __cropBox.y - (temp / 2) >= __imageBox.y && __cropBox.y + __cropBox.height + (temp / 2) < __imageBox.y + __imageBox.height
&& (__cropBox.width - (2 * deltaX) > (CROP_RECTANGLE_HEIGHT * 3)))
{
+ AppLog("Manish 0");
__cropBox.x += deltaX;
__cropBox.width = __cropBox.width - (2 * deltaX);
__cropBox.height = height;
&& __cropBox.width < __imageBox.width
&& __cropBox.x + deltaX >= __imageBox.x && __cropBox.y - temp >= __imageBox.y )
{
+ AppLog("Manish 1");
if (__cropBox.x + __cropBox.width - deltaX <= __imageBox.x + __imageBox.width
&& __cropBox.x + deltaX >= __imageBox.x)
{
+ //AppLog("Manish 2");
__cropBox.x += deltaX;
}
else
{
+ AppLog("Manish 3");
__cropBox.x = __cropBox.x + (2 * deltaX);
}
__cropBox.width = __cropBox.width - (2 * deltaX);
{
if (__cropBox.x + __cropBox.width - deltaX <= __imageBox.x + __imageBox.width)
{
+ AppLog("Manish 4");
__cropBox.x += deltaX;
}
else
{
+ AppLog("Manish 5");
__cropBox.x = __cropBox.x + (2 * deltaX);
}
__cropBox.width = __cropBox.width - (2 * deltaX);
if (__cropBox.x + deltaX > __imageBox.x && __cropBox.x + __cropBox.width - deltaX <= __imageBox.x + __imageBox.width
&& __cropBox.y - (temp / 2) > __imageBox.y && __cropBox.y + __cropBox.height + (temp / 2) < __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 0");
__cropBox.x += deltaX;
__cropBox.width = __cropBox.width - (2 * deltaX);;
__cropBox.height = height;
&& __cropBox.x + __cropBox.width - (2 * deltaX) <= __imageBox.x + __imageBox.width
&& __cropBox.x - deltaX >= __imageBox.x && __cropBox.y - temp >= __imageBox.y )
{
+ AppLog("Manish 1");
if (__cropBox.x + __cropBox.width - deltaX <= __imageBox.x + __imageBox.width
&& __cropBox.x + deltaX >= __imageBox.x)
{
+ AppLog("Manish 2");
__cropBox.x += deltaX;
}
else
{
+ AppLog("Manish 3");
__cropBox.width = __cropBox.width - (2 * deltaX);
}
__cropBox.width = __cropBox.width - (2 * deltaX);
else if (__cropBox.y - (temp / 2) <= __imageBox.y && __cropBox.width - (deltaX) <= __imageBox.width
&& __cropBox.x + deltaX <= __imageBox.x && __cropBox.y + __cropBox.height + temp <= __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 25");
if (__cropBox.x + deltaX >= __imageBox.x)
{
+ AppLog("Manish 4");
__cropBox.x += deltaX;
}
else
&& __cropBox.x + __cropBox.width - deltaX <= __imageBox.x + __imageBox.width
&& __cropBox.y + __cropBox.height + temp <= __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 999");
__cropBox.x += deltaX;
__cropBox.width = __cropBox.width - (2 * deltaX);
__cropBox.height = height;
if (__cropBox.x - (temp /2 ) > __imageBox.x && __cropBox.x + __cropBox.width + temp < __imageBox.x + __imageBox.width
&& __cropBox.y + (deltaY) > __imageBox.y && __cropBox.y + __cropBox.height - (2 * deltaY) < __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 0");
__cropBox.y += deltaY;
__cropBox.height = __cropBox.height - (2 * deltaY);
__cropBox.width = width;
}
else if (__cropBox.x - (temp / 2) < __imageBox.x)
{
+ AppLog("manish 55");
if (__cropBox.x + __cropBox.width + temp <= __imageBox.x + __imageBox.width)
{
__cropBox.width = width;
}
if (__cropBox.y + __cropBox.height - (2 * deltaY) < __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 56");
__cropBox.height = __cropBox.height - (2 * deltaY);
}
}
else if (__cropBox.y + __cropBox.height - (2 * deltaY) >= __imageBox.x + __imageBox.height
&& __cropBox.y + (2 * deltaY) >= __imageBox.y)
{
+ AppLog("Manish 1");
if (__cropBox.x - temp >= __imageBox.x
&& __cropBox.x + __cropBox.width + temp > __imageBox.x + __imageBox.width)
{
&& __cropBox.x - temp >= __imageBox.x && __cropBox.y + deltaY >= __imageBox.y
&& __cropBox.y + __cropBox.height - (2 * deltaY) <= __imageBox.y + __imageBox.height)
{
+ AppLog("manish 58");
__cropBox.x = __cropBox.x - temp;
__cropBox.width = width;
__cropBox.y += deltaY;
}
else if (__pointLocation == INSIDE_BOTTOM_RECTANGLE)
{
+ AppLog("Manish INSIDE BOTTOM RECTANGLE");
deltaY = deltaY * (-1);
int temp = __cropBox.width;
int width = (__formWidth * (__cropBox.height - (2 * deltaY))) / __formHeight;
if (__cropBox.x - (temp / 2) >= __imageBox.x && __cropBox.x + __cropBox.width + temp < __imageBox.x + __imageBox.width
&& __cropBox.y + deltaY > __imageBox.y && __cropBox.y + __cropBox.height - (2 * deltaY) < __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 0");
__cropBox.y += deltaY;
__cropBox.height = __cropBox.height - (2 * deltaY);;
__cropBox.width = width;
else if (__cropBox.y + deltaY < __imageBox.y && __cropBox.y + __cropBox.height - (2 * deltaY) < __imageBox.y + __imageBox.height
&& __cropBox.x - (temp / 2) > __imageBox.x && __cropBox.x + __cropBox.width + temp < __imageBox.x + __imageBox.width)
{
+ AppLog("Manish 1");
__cropBox.x = __cropBox.x - (temp / 2);
__cropBox.width = width;
__cropBox.height = __cropBox.height - (2 * deltaY);
&& __cropBox.y + deltaY >= __imageBox.y && __cropBox.y + __cropBox.height + temp <= __imageBox.y + __imageBox.height
&& __cropBox.x - temp >= __imageBox.x)
{
+ AppLog("Manish 2");
__cropBox.x = __cropBox.x - temp;
__cropBox.y += deltaY;
__cropBox.width = width;
&& __cropBox.y + deltaY <= __imageBox.y && __cropBox.x - temp > __imageBox.x
&& __cropBox.y + __cropBox.height + temp < __imageBox.y + __imageBox.height)
{
+ AppLog("Manish 3");
__cropBox.x -= temp;
__cropBox.width = width;
__cropBox.height = __cropBox.height - (2 * deltaY);
else if (__cropBox.x - temp < __imageBox.x && __cropBox.x + __cropBox.width + temp <= __imageBox.x + __imageBox.width
&& __cropBox.y + __cropBox.height - (2 * deltaY) <= __imageBox.y + __imageBox.height)
{
+ AppLog("manish 4");
if (__cropBox.y + deltaY >= __imageBox.y)
{
__cropBox.y += deltaY;
__formHeight = Form::GetBounds().width;
__formWidth = Form::GetBounds().height;
}
+ AppLog("Manish h value %d", __formHeight);
+ AppLog("Manish w value %d", __formWidth);
float clientAreaRatio = (GetClientAreaBoundsF().height - FOOTER_PANEL_HEIGHT) / GetClientAreaBoundsF().width;
+ AppLog("Manish %f", clientAreaRatio);
if (__imageWidth >= GetClientAreaBounds().width || __imageHeight > (GetClientAreaBounds().height - FOOTER_PANEL_HEIGHT))
{
float imageRatio = __imageHeight / (float) __imageWidth;
{
__cropBox.width = (2 * __imageBox.width) / 3;
__cropBox.height = (__formHeight * __cropBox.width / __formWidth);
+ if (__cropBox.height > __imageBox.height)
+ {
+ __cropBox.height = (2 * __imageBox.height) / 3;
+ __cropBox.width = (__cropBox.height * __formWidth) / __formHeight;
+ }
__cropBox.y = __imageBox.y + (__imageBox.height - __cropBox.height) / 2;
__cropBox.x = __imageBox.x + (__imageBox.width - __cropBox.width) / 2;
}
{
__cropBox.height = (2 *__imageBox.height) / 3;
__cropBox.width = (__formWidth * __cropBox.height / __formHeight);
+ if (__cropBox.width > __imageBox.width)
+ {
+ __cropBox.width = (2 * __imageBox.width) / 3;
+ __cropBox.height = (__formHeight * __cropBox.width) / __formWidth;
+ }
__cropBox.y = __imageBox.y + (__imageBox.height - __cropBox.height) / 2;
__cropBox.x = __imageBox.x + (__imageBox.width - __cropBox.width) / 2;
}
temp = (__cropBox.width * __imageBox.width) / (float)prevWidth;
__cropBox.width = (temp + 0.5);
}
+ AppLog("Manish %d %d", __imageBox.width, __imageBox.height);
+ AppLog("Manish %d %d", __cropBox.width, __cropBox.height);
__pCanvas = GetCanvasN();
__pCanvas->SetForegroundColor(CROP_BOX_RECTANGLE_COLOR);
}
void ImageCropForm::OnFormFileEventOccuered(const int index, const unsigned long eventId)
{
AppLogDebug(" ENTER");
- UiApp::GetInstance()->Terminate();
+ if (File::IsFileExist(__sourceFilePath) == false)
+ {
+ UiApp::GetInstance()->Terminate();
+ }
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}