本文整理汇总了C++中Image::DecodeN方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::DecodeN方法的具体用法?C++ Image::DecodeN怎么用?C++ Image::DecodeN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image
的用法示例。
在下文中一共展示了Image::DecodeN方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fullname
Osp::Graphics::Bitmap* Utils::GetBitmapN(const Osp::Base::String& name)
{
Bitmap* pBitmap = null;
Image* pImage = new Image();
String fullname(L"/Res/");
fullname.Append(name);
pImage->Construct();
//AppLogDebug("%S",fullname.GetPointer());
if(fullname.EndsWith(L"jpg"))
{
pBitmap = pImage->DecodeN(fullname, BITMAP_PIXEL_FORMAT_RGB565);
}
else if(fullname.EndsWith(L"bmp"))
{
pBitmap = pImage->DecodeN(fullname, BITMAP_PIXEL_FORMAT_RGB565);
}
else if(fullname.EndsWith(L"png"))
{
pBitmap = pImage->DecodeN(fullname, BITMAP_PIXEL_FORMAT_ARGB8888);
}
else if (fullname.EndsWith(L"gif"))
{
pBitmap = pImage->DecodeN(fullname, BITMAP_PIXEL_FORMAT_RGB565);
}
delete pImage;
return pBitmap;
}
示例2: Update
void Dart::Update(int delta)
{
float distance = sqrt(pow(movementOffset.x, 2) + pow(movementOffset.y, 2));
position->SetPosition(Point(position->x + movementOffset.x / distance * delta * DART_SPEED,
position->y + movementOffset.y / distance * delta * DART_SPEED));
ArrayList* zombies = WorldManager::Instance()->GetImagesByNameN(ZOMBIE);
IEnumerator* pEnum = zombies->GetEnumeratorN();
Zombie* zombie = null;
bool found = false;
while (pEnum->MoveNext() == E_SUCCESS && !found)
{
zombie = (Zombie*)pEnum->GetCurrent();
Point offset = Point(position->x + ressource->GetWidth()/2 - zombie->position->x - zombie->ressource->GetWidth()/2, position->y + ressource->GetHeight()/2 - zombie->position->y - zombie->ressource->GetHeight()/2);
float distance = sqrt(pow(offset.x, 2) + pow(offset.y, 2));
if(distance < 50)
{
Image* bitmapDecoder = new Image();
bitmapDecoder->Construct();
WorldManager::Instance()->AddImage(new KImage(bitmapDecoder->DecodeN(L"/Home/Res/zombie_dead.png", BITMAP_PIXEL_FORMAT_ARGB8888), new Point(*(zombie->position)), ZOMBIE_DEAD));
WorldManager::Instance()->DeleteImage(zombie);
WorldManager::Instance()->DeleteImage(this);
delete bitmapDecoder;
found = true;
}
}
delete pEnum;
delete zombies;
}
示例3: fullname
Tizen::Graphics::Bitmap*
JMChattControl::GetBitmapN(const Tizen::Base::String& name)
{
Bitmap* pBitmap = null;
Image* pImage = new Image();
pImage->Construct();
String fullname(L"");
fullname.Append(name);
if(fullname.EndsWith(L"png")) {
pBitmap = pImage->DecodeN(fullname, BITMAP_PIXEL_FORMAT_ARGB8888);
}
else {
pBitmap = pImage->DecodeN(fullname, BITMAP_PIXEL_FORMAT_RGB565);
}
delete pImage;
return pBitmap;
}
示例4: OnUserEventReceivedN
void BitmapLoader::OnUserEventReceivedN(RequestId requestId, IList *pArgs) {
ICacheEntry *cacheEntry = static_cast<ICacheEntry *>(pArgs->GetAt(0));
Image image;
image.Construct();
Bitmap *bitmap = image.DecodeN(cacheEntry->GetFile(), BITMAP_PIXEL_FORMAT_RGB565);
if(GetLastResult() == E_SUCCESS) {
cacheEntry->OnLoadingSuccess(bitmap);
} else {
cacheEntry->OnLoadingError();
}
delete pArgs;
}
示例5: Image
//IGalleryItemProvider
Osp::Ui::Controls::GalleryItem* GalleryForm::CreateItem(int index) {
String *imagePath = static_cast<String *>(pImagesPaths->GetAt(index));
Image* pImage = new Image();
pImage->Construct();
Bitmap * pBitmap = pImage->DecodeN(*imagePath, BITMAP_PIXEL_FORMAT_ARGB8888);
delete pImage;
GalleryItem* pGalleryItem = new GalleryItem();
pGalleryItem->Construct(*pBitmap, *imagePath);
delete pBitmap;
return pGalleryItem;
}
示例6: GetClientAreaBounds
void
CropForm::LoadImage(String *filename)
{
__Croprectangle.x = __x_min ;
__Croprectangle.y = __y_min ;
__Croprectangle.width = __x_max-__x_min;
__Croprectangle.height = __y_max-__y_min;
int width = GetClientAreaBounds().width;
int height = GetClientAreaBounds().height;
Image img;
img.Construct();
__pBitmapOriginal = img.DecodeN(*filename, BITMAP_PIXEL_FORMAT_ARGB8888 , width, height);
__pBitmapOriginal->Scale(Dimension(width, height));
RequestRedraw();
}