You Are Here:

Community: Developer Discussion Boards

#1 Old Question Application Background - 2008-08-16, 20:59

Join Date: Apr 2008
Posts: 32
Faisal Rehman
Offline
Registered User
hi

i want set an image as a background of my application.
please tell me how to set background on
appuifw.app.body

thanx
Reply With Quote

#2 Old Re: Application Background - 2008-08-16, 21:07

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Online
Forum Nokia Champion
Hi,

You can do it something like this:
Code:
import appuifw, graphics

#Open the image
img=graphics.Image.open("C:\\picture.jpg") #For example

#Create an instance of Canvas
canvas=appuifw.Canvas()

#Set it as the backgroung
appuifw.app.body=canvas

#Put the image on it
canvas.blit(img)
Last edited by bogdan.galiceanu : 2008-08-16 at 21:18. Reason: Typo
Reply With Quote

#3 Old Re: Application Background - 2008-08-16, 21:21

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
hi Faisal Rehman
Just a bit to add also dont forget to resize your image so that the image will be applicapable universal.
For this i suggest before applying the image to the canvas body just resize the image according to your screen size.

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#4 Old Re: Application Background - 2008-08-16, 21:26

Join Date: Dec 2004
Posts: 37
n6630
Offline
Registered User
Quote:
Originally Posted by gaba88 View Post
hi Faisal Rehman
Just a bit to add also dont forget to resize your image so that the image will be applicapable universal.
For this i suggest before applying the image to the canvas body just resize the image according to your screen size.

Enjoy Pythoning
Gaba88
if u want the image to be "applicapable" universally why tell him to resize it according to his screen size? Wuldn't it be better to resize with sysinfo.display_pixels() so that it would work on any mobile phon?
Reply With Quote

#5 Old Re: Application Background - 2008-08-16, 21:34

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
hi n6630
yes we can do that also but if we apply this code before applying the image to the canvas then also i think the image will fit in all phones.
Code:
img = graphics.Image.open("image name")
img.resize((canvas.size))
Regards
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#6 Old Re: Application Background - 2008-08-16, 21:44

Join Date: Dec 2004
Posts: 37
n6630
Offline
Registered User
Quote:
Originally Posted by gaba88 View Post
hi n6630
yes we can do that also but if we apply this code before applying the image to the canvas then also i think the image will fit in all phones.
Code:
img = graphics.Image.open("image name")
img.resize((canvas.size))
Regards
Gaba88
yes but u didnt say that. U just said "resize the image according to your screen size", so I thought u meant to hard-code the size
Reply With Quote

#7 Old Re: Application Background - 2008-08-16, 21:53

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by n6630 View Post
yes but u didnt say that. U just said "resize the image according to your screen size", so I thought u meant to hard-code the size
hi n6630
i didnt mean to hrad code the size. Actually i was editting the post to give the code so that my point can be clear but you posted the doubt early.
But anyways i think faisal and you must be clear with my point now.

Enjoy Pythoning
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help to bring an background application to foreground gigglie General Symbian C++ 0 2008-04-24 13:33
How to start a application in background? shunxing General Symbian C++ 3 2008-03-14 11:03
Background application iulian_moldovan General Symbian C++ 1 2007-02-16 23:44
Background application 1xuname1x Mobile Java General 2 2006-05-25 19:18
Application in background problem kiranpuranik General Symbian C++ 2 2006-04-20 08:56

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia