本文整理汇总了C++中Image::EncodeToFile方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::EncodeToFile方法的具体用法?C++ Image::EncodeToFile怎么用?C++ Image::EncodeToFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image::EncodeToFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fileNameKey
void
ImageViewer::SaveImage(void)
{
if(savedPath.GetLength() != 0)
return; /*Already saved*/
result res = E_SUCCESS;
Image img;
String fileName;
int lastFileName = 0;
String fileNameKey("AppLastSavedFileNum");
AppRegistry *pAppRegistry = Application::GetInstance()->GetAppRegistry();
res = pAppRegistry->Get(fileNameKey, lastFileName);
if ( res == E_KEY_NOT_FOUND)
{
lastFileName = 1;
pAppRegistry->Add(fileNameKey, lastFileName);
}
savedPath = L"/Media/Images/";
savedPath += Application::GetInstance()->GetAppName();
savedPath.Append(lastFileName);
savedPath += ".jpg";
img.Construct();
res = img.EncodeToFile(*__pDisplayImage, IMG_FORMAT_JPG, savedPath, true);
pAppRegistry->Set(fileNameKey, lastFileName + 1);
}
示例2: Bitmap
void
CropForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId)
{
if(actionId == ID_FOOTERITEMCROP)
{
__Croprectangle.x = __x_min ;
__Croprectangle.y = __y_min ;
__Croprectangle.width = __x_max - __x_min;
__Croprectangle.height = __y_max - __y_min;
if ((__Croprectangle.width <= 0) || (__Croprectangle.height <= 0))
{
MessageBox messageBox;
messageBox.Construct(L"Noting to crop", L"Please select region using finger to crop.", MSGBOX_STYLE_OK, 3000);
int modalResult = 0;
messageBox.ShowAndWait(modalResult);
return;
}
Bitmap *pBitmapCroped = new Bitmap();
pBitmapCroped->Construct(*__pBitmapOriginal,__Croprectangle);
Image img;
result r = img.Construct();
if(!IsFailed(r))
{
img.EncodeToFile(*pBitmapCroped, IMG_FORMAT_JPG, USER_CROPPED_FILE_PATH, true);
AppLogDebug("Save_location : %S", USER_CROPPED_FILE_PATH.GetPointer());
Frame *pFrame = Application::GetInstance()->GetAppFrame()->GetFrame();
Form *pForm = (Form*)pFrame->GetControl(MAIN_FORM_NAME, false);
if(pForm)
{
pFrame->SetCurrentForm(*pForm);
pForm->SendUserEvent(CROPPING_COMPLETE, null);
pForm->Draw();
pForm->Show();
pFrame->RemoveControl(*this);
}
}
delete pBitmapCroped;
}
}