yeasir007

Tuesday, December 24, 2013

How to set background image in Tizen native application

Add a folder named "screen-density-xhigh" to the resource folder and store image to this folder that you want to set as application background. Now declare result type onDraw() function into the application header.Now implement the code bellow to the .cpp file of this form.
 result TizenForm::OnDraw()
  {

    result r = E_UNKNOWN;
    AppResource *pAppResource = Application::GetInstance()->GetAppResource();
    Bitmap* pBitmap1 = pAppResource->GetBitmapN(L"backgroundImage.jpg");
    Canvas* pCanvas = GetCanvasN();
    if (pCanvas != null)
    {
      pCanvas->DrawBitmap(Rectangle(0, 0,720,1280), *pBitmap1);
    }

    return r;

 }

No comments:

Post a Comment

Thanks for your comments