当前位置: 首页>>代码示例>>C++>>正文


C++ Image::DecodeN方法代码示例

本文整理汇总了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;
}
开发者ID:iRail,项目名称:BeTrains.Bada,代码行数:30,代码来源:Utils.cpp

示例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;

}
开发者ID:Azagthoth,项目名称:KawaiiZombie,代码行数:30,代码来源:Dart.cpp

示例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;
}
开发者ID:JunminLee,项目名称:Winwin,代码行数:20,代码来源:JMChattControl.cpp

示例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;
}
开发者ID:igorglotov,项目名称:tizen-vk-client,代码行数:15,代码来源:BitmapLoader.cpp

示例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;
}
开发者ID:drstrangecode,项目名称:BadaImageGallery_SampleApp,代码行数:17,代码来源:GalleryForm.cpp

示例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();
}
开发者ID:CoCoTeam,项目名称:TizenGameHub,代码行数:18,代码来源:CropForm.cpp


注:本文中的Image::DecodeN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。