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


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

本文整理汇总了C++中Image::Construct方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::Construct方法的具体用法?C++ Image::Construct怎么用?C++ Image::Construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Image的用法示例。


在下文中一共展示了Image::Construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: 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

示例2: 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);

}
开发者ID:SciDev030,项目名称:badaget,代码行数:31,代码来源:ImageViewer.cpp

示例3: 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

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

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

示例8: 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


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