Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Quick question about canvas

Quick question about canvas

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Quick question about canvas

Postby isaackearl » Wed Jan 07, 2009 1:18 am

i have a simple program i'm working on and right now I have a background color set using

canvas.drawColor(int);

i'm just wondering if there is a simple way to set a background image rather then just a color. And if someone could point me in the right direction.

Thanks
isaackearl
Junior Developer
Junior Developer
 
Posts: 20
Joined: Tue Nov 25, 2008 8:09 pm

Top

Postby Quetzalcoatl » Wed Jan 07, 2009 11:34 am

Stick a suitable image in your res/drawable folder.

Make a suitable member of your view

Code: Select all
private Drawable mBackgroundImage;        //background image bmp


& in your View's constructor


Code: Select all
mBackgroundImage = getResources().getDrawable(YOUR_IMAGE);
        this.setBackgroundDrawable(mBackgroundImage);

:D
Image
Quetzalcoatl
Senior Developer
Senior Developer
 
Posts: 129
Joined: Sat Oct 18, 2008 8:21 pm
Location: near Manchester, UK

Postby isaackearl » Wed Jan 07, 2009 7:27 pm

thanks, worked like a charm.
isaackearl
Junior Developer
Junior Developer
 
Posts: 20
Joined: Tue Nov 25, 2008 8:09 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 5 guests