Hi :)
I'm writing code for wallpaper in form like this
result MorningAlarmForm::OnDraw() { result r; Canvas* canvas=this->GetCanvasN(); //background Image img; Bitmap* pBitmap = null; Canvas* pCanvas = null; String filePath = Tizen::App::App::GetInstance()->GetAppRootPath() + L"img/Homescreen_sunny_day_bg.png"; img.Construct(); // Decodes the image pBitmap = img.DecodeN(filePath, BITMAP_PIXEL_FORMAT_R8G8B8A8 ); //pBitmap = pAppResource->GetBitmapN(filePath, BITMAP_PIXEL_FORMAT_ARGB8888); r= canvas->DrawBitmap(Rectangle(0, 66,480,800-138), * pBitmap); if (IsFailed(r)) { AppLog("Draw Bitmap Failed"); return r; } return r; }
But, When I run this code, I get this log
11-28 10:06:27.150 : INFO / MorningAlarm ( 7263 : 7263 ) : int OspMain(int, char **)(20) > Application started. 11-28 10:06:27.170 : ERROR / Tizen::Base::Collection ( 2421 : 2421 ) : virtual const Tizen::Base::Object* Tizen::Base::Collection::ArrayList::GetAt(int) const(238) > [E_OUT_OF_RANGE] The index(2) MUST be greater than or equal to 0 and less than the number of elements(2). 11-28 10:06:27.190 : ERROR / Tizen::Ui ( 7263 : 7263 ) : bool Tizen::Ui::_Control::IsVisible() const(2943) > [E_SYSTEM] This control should be attached to the main tree. 11-28 10:06:27.210 : ERROR / Tizen::Io ( 7263 : 7263 ) : result Tizen::Io::_DirEnumeratorImpl::MoveNext()(143) > [E_END_OF_FILE] End of directory entries 11-28 10:06:27.210 : ERROR / Tizen::App ( 7263 : 7263 ) : virtual Tizen::Graphics::Bitmap* Tizen::App::_AppResourceBitmap::GetBitmapN(const Tizen::Base::String&, Tizen::Graphics::BitmapPixelFormat, bool) const(84) > [E_FILE_NOT_FOUND] The specified file does not exist. 11-28 10:06:27.210 : ERROR / Tizen::Graphics ( 7263 : 7263 ) : result Tizen::Graphics::Canvas::DrawBitmap(const Tizen::Graphics::Rectangle&, const Tizen::Graphics::Bitmap&)(257) > [E_INVALID_ARG] The source bitmap is invalid. 11-28 10:06:27.210 : INFO / MorningAlarm ( 7263 : 7263 ) : virtual result MorningAlarmForm::OnDraw()(127) > Draw Bitmap Failed
I think the reason is to convert png to bitmap.
What should I do ?
Please let me know
Best Regards,
Jenny