__pCurrentBitmap = __imageBuffer.GetBitmapN(BITMAP_PIXEL_FORMAT_RGB565, BUFFER_SCALING_AUTO);
}
Image img;
- img.Construct();
- __imageFormat = img.GetImageFormat(__sourceFilePath);
+ r = img.Construct();
+ if (r == E_SUCCESS)
+ {
+ __imageFormat = img.GetImageFormat(__sourceFilePath);
+ }
}
SetValue();
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
}
pCropBuffer = __imageBuffer.CropN(((__cropBox.x - __imageBox.x) * __imageWidth) / __imageBox.width, ((__cropBox.y - __imageBox.y) * __imageHeight) / __imageBox.height,
- (__cropBox.width * __imageWidth) / __imageBox.width, (__cropBox.height * __imageHeight) / __imageBox.height);
+ (__cropBox.width * __imageWidth) / __imageBox.width, (__cropBox.height * __imageHeight) / __imageBox.height);
pCropBuffer->EncodeToFile(destFilePath, __imageFormat, true, 100);
ContentManager::ScanFile(destFilePath);
delete pCropBuffer;
if (__statusValue == SET_AT_TYPE_HOME_SCREEN_WALLPAPER)
{
String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER;
- r = pCropBuffer->EncodeToFile(destPath, __imageFormat, true, 100);
+ r = pCropBuffer->EncodeToFile(destPath, IMG_FORMAT_JPG, true, 100);
if (r == E_SUCCESS)
{
r = SettingInfo::SetValue(SETTING_VALUE_HOME_SCREEN_WALLPAPER, destPath);
else if (__statusValue == SET_AT_TYPE_LOCK_SCREEN_WALLPAPER)
{
String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER;
- r = pCropBuffer->EncodeToFile(destPath, __imageFormat, true, 100);
+ r = pCropBuffer->EncodeToFile(destPath, IMG_FORMAT_JPG, true, 100);
if (r == E_SUCCESS)
{
r = SettingInfo::SetValue(SETTING_VALUE_LOCK_SCREEN_WALLPAPER, destPath);
{
String destPath = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_LOCK_SCREEN_WALLPAPER;
String destPathHome = App::GetInstance()->GetAppDataPath() + TEMP_FILE_PATH_HOME_SCREEN_WALLPAPER;
- r = pCropBuffer->EncodeToFile(destPath, __imageFormat, true, 100);
- r = pCropBuffer->EncodeToFile(destPathHome, __imageFormat, true, 100);
+ r = pCropBuffer->EncodeToFile(destPath, IMG_FORMAT_JPG, true, 100);
+ r = pCropBuffer->EncodeToFile(destPathHome, IMG_FORMAT_JPG, true, 100);
if (r == E_SUCCESS)
{
r = SettingInfo::SetValue(SETTING_VALUE_LOCK_SCREEN_WALLPAPER, destPath);
r = SettingInfo::SetValue(SETTING_VALUE_HOME_SCREEN_WALLPAPER, destPathHome);
}
- else if (r == E_OVERFLOW)
- {
- MessageBox messageBox;
- messageBox.Construct(L"", L"File size is too big", MSGBOX_STYLE_NONE, 3000);
- int modalResult = 0;
- messageBox.ShowAndWait(modalResult);
- }
}
else if (__statusValue == SET_AT_TYPE_CALLER_IMAGE)
{
destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
}
}
- r = pCropBuffer->EncodeToFile(destFilePath, __imageFormat, true, 100);
+ r = pCropBuffer->EncodeToFile(destFilePath, IMG_FORMAT_JPG, true, 100);
ContentManager::ScanFile(destFilePath);
Contact* pContact = null;
AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
{
case INSIDE_TOP_RECTANGLE:
{
- if ((__cropBox.y + deltaY) > __imageBox.y && deltaY < (__cropBox.height - (H_CROP_RECTANGLE * 5)))
+ if ((__cropBox.y + deltaY) > __imageBox.y && deltaY < (__cropBox.height - (H_CROP_RECTANGLE * 3)))
{
__cropBox.y += deltaY;
__cropBox.height -= deltaY;
case INSIDE_BOTTOM_RECTANGLE:
{
if ((__cropBox.y + __cropBox.height + deltaY) < (__imageBox.y + __imageBox.height)
- && (__cropBox.height + deltaY) > (H_CROP_RECTANGLE * 5))
+ && (__cropBox.height + deltaY) > (H_CROP_RECTANGLE * 3))
{
__cropBox.height += deltaY;
}
case INSIDE_LEFT_RECTANGLE:
{
- if ((__cropBox.x + deltaX) > __imageBox.x && deltaX < __cropBox.width - (H_CROP_RECTANGLE * 5))
+ if ((__cropBox.x + deltaX) > __imageBox.x && deltaX < __cropBox.width - (H_CROP_RECTANGLE * 3))
{
__cropBox.x += deltaX;
__cropBox.width -= deltaX;
case INSIDE_RIGHT_RECTANGLE:
{
if ((__cropBox.x + __cropBox.width + deltaX) < (__imageBox.x + __imageBox.width)
- && __cropBox.width + deltaX > (H_CROP_RECTANGLE * 5))
+ && __cropBox.width + deltaX > (H_CROP_RECTANGLE * 3))
{
__cropBox.width += deltaX;
}
case INSIDE_TOP_LEFT_RECTANGLE:
{
- if ((__cropBox.y + deltaY) > __imageBox.y && deltaY < (__cropBox.height - (H_CROP_RECTANGLE * 5))
- && (__cropBox.x + deltaX) > __imageBox.x && deltaX < __cropBox.width - (H_CROP_RECTANGLE * 5))
+ if ((__cropBox.y + deltaY) > __imageBox.y && deltaY < (__cropBox.height - (H_CROP_RECTANGLE * 3))
+ && (__cropBox.x + deltaX) > __imageBox.x && deltaX < __cropBox.width - (H_CROP_RECTANGLE * 3))
{
__cropBox.y += deltaY;
__cropBox.height -= deltaY;
case INSIDE_TOP_RIGHT_RECTANGLE:
{
- if ((__cropBox.y + deltaY) > __imageBox.y && deltaY < (__cropBox.height - (H_CROP_RECTANGLE * 5))
- && (__cropBox.x + __cropBox.width + deltaX) < (__imageBox.x + __imageBox.width) && __cropBox.width + deltaX > (H_CROP_RECTANGLE * 5))
+ if ((__cropBox.y + deltaY) > __imageBox.y && deltaY < (__cropBox.height - (H_CROP_RECTANGLE * 3))
+ && (__cropBox.x + __cropBox.width + deltaX) < (__imageBox.x + __imageBox.width) && __cropBox.width + deltaX > (H_CROP_RECTANGLE * 3))
{
__cropBox.width += deltaX;
__cropBox.y += deltaY;
case INSIDE_BOTTOM_LEFT_RECTANGLE:
{
- if ((__cropBox.y + __cropBox.height + deltaY) < (__imageBox.y + __imageBox.height) && (__cropBox.height + deltaY) > (H_CROP_RECTANGLE * 5)
- && (__cropBox.x + deltaX) > __imageBox.x && deltaX < __cropBox.width - (H_CROP_RECTANGLE * 5))
+ if ((__cropBox.y + __cropBox.height + deltaY) < (__imageBox.y + __imageBox.height) && (__cropBox.height + deltaY) > (H_CROP_RECTANGLE * 3)
+ && (__cropBox.x + deltaX) > __imageBox.x && deltaX < __cropBox.width - (H_CROP_RECTANGLE * 3))
{
__cropBox.x += deltaX;
__cropBox.width -= deltaX;
case INSIDE_BOTTOM_RIGHT_RECTANGLE:
{
- if ((__cropBox.x + __cropBox.width + deltaX) < (__imageBox.x + __imageBox.width) && __cropBox.width + deltaX > (H_CROP_RECTANGLE * 5)
- && (__cropBox.y + __cropBox.height + deltaY) < (__imageBox.y + __imageBox.height) && (__cropBox.height + deltaY) > (H_CROP_RECTANGLE * 5))
+ if ((__cropBox.x + __cropBox.width + deltaX) < (__imageBox.x + __imageBox.width) && __cropBox.width + deltaX > (H_CROP_RECTANGLE * 3)
+ && (__cropBox.y + __cropBox.height + deltaY) < (__imageBox.y + __imageBox.height) && (__cropBox.height + deltaY) > (H_CROP_RECTANGLE * 3))
{
__cropBox.width += deltaX;
__cropBox.height += deltaY;
int temp = __cropBox.height;
int height = (__formHeight * (__cropBox.width - (2 * deltaX))) /__formWidth;
temp = height - temp;
- if ((__cropBox.width - (2 * deltaX) > (H_CROP_RECTANGLE * 5)) && (!(height >= __imageBox.height || (__cropBox.width - (2 * deltaX)) >= __imageBox.width)))
+ if ((__cropBox.width - (2 * deltaX) > (H_CROP_RECTANGLE * 3)) && (!(height >= __imageBox.height || (__cropBox.width - (2 * deltaX)) >= __imageBox.width)))
{
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
- && (__cropBox.width - (2 * deltaX) > (H_CROP_RECTANGLE * 5)))
+ && (__cropBox.width - (2 * deltaX) > (H_CROP_RECTANGLE * 3)))
{
__cropBox.x += deltaX;
__cropBox.width = __cropBox.width - (2 * deltaX);
int temp = __cropBox.height;
int height = (__formHeight * (__cropBox.width - (2 * deltaX))) / __formWidth;
temp = height - temp;
- if ((__cropBox.width - (2 * deltaX) > (H_CROP_RECTANGLE * 5)) && (!(height >= __imageBox.height || (__cropBox.width - (2 * deltaX)) >= __imageBox.width)))
+ if ((__cropBox.width - (2 * deltaX) > (H_CROP_RECTANGLE * 3)) && (!(height >= __imageBox.height || (__cropBox.width - (2 * deltaX)) >= __imageBox.width)))
{
- if (deltaX < __cropBox.width - (H_CROP_RECTANGLE * 5))
+ if (deltaX < __cropBox.width - (H_CROP_RECTANGLE * 3))
{
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)
int temp = __cropBox.width;
int width = (__formWidth * (__cropBox.height - (2 * deltaY))) / __formHeight;
temp = width - temp;
- if (__cropBox.height - (2 * deltaY) > (__formHeight * (H_CROP_RECTANGLE * 5)) / __formWidth && (!(__cropBox.height - (2 * deltaY) >= __imageBox.height || width >= __imageBox.width)))
+ if (__cropBox.height - (2 * deltaY) > (__formHeight * (H_CROP_RECTANGLE * 3)) / __formWidth && (!(__cropBox.height - (2 * deltaY) >= __imageBox.height || width >= __imageBox.width)))
{
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)
int temp = __cropBox.width;
int width = (__formWidth * (__cropBox.height - (2 * deltaY))) / __formHeight;
temp = width - temp;
- if (__cropBox.height - (2 * deltaY) > (__formHeight * (H_CROP_RECTANGLE * 5)) / __formWidth && (!(__cropBox.height - (2 * deltaY) >= __imageBox.height || width >= __imageBox.width)))
+ if (__cropBox.height - (2 * deltaY) > (__formHeight * (H_CROP_RECTANGLE * 3)) / __formWidth && (!(__cropBox.height - (2 * deltaY) >= __imageBox.height || width >= __imageBox.width)))
{
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)
int prevWidth = __imageBox.width;
int prevImageboxX = __imageBox.x;
int prevImageBoxY = __imageBox.y;
+
if (GetOrientationStatus() == ORIENTATION_STATUS_PORTRAIT)
{
__formHeight = Form::GetBounds().height;
}
float clientAreaRatio = (GetClientAreaBoundsF().height - H_FOOTER_PANEL) / GetClientAreaBoundsF().width;
+
if (__imageWidth >= GetClientAreaBounds().width || __imageHeight > (GetClientAreaBounds().height - H_FOOTER_PANEL))
{
float imageRatio = __imageHeight / (float) __imageWidth;
}
else
{
- float temp = __imageBox.x + ((__cropBox.x - prevImageboxX) * __imageBox.width) / (float)prevWidth;
+ float temp = __imageBox.x + ((__cropBox.x - prevImageboxX) * __imageBox.width) / (float) prevWidth;
__cropBox.x = (temp + 0.5);
- temp = __imageBox.y + ((__cropBox.y - prevImageBoxY) * __imageBox.height) / (float)prevHeight;
+ temp = __imageBox.y + ((__cropBox.y - prevImageBoxY) * __imageBox.height) / (float) prevHeight;
__cropBox.y = (temp + 0.5);
- temp = (__cropBox.height * __imageBox.height) / (float)prevHeight;
+ temp = (__cropBox.height * __imageBox.height) / (float) prevHeight;
__cropBox.height = (temp + 0.5);
- temp = (__cropBox.width * __imageBox.width) / (float)prevWidth;
+ temp = (__cropBox.width * __imageBox.width) / (float) prevWidth;
__cropBox.width = (temp + 0.5);
}
__pCanvas = GetCanvasN();