| Reply | « Previous Thread | Next Thread » |
|
hi
![]() i want set an image as a background of my application. please tell me how to set background on appuifw.app.body thanx ![]() |
| Faisal Rehman |
| View Public Profile |
| Find all posts by Faisal Rehman |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
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
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
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 |
|
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?
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
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))
Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
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
|
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |