| Reply | « Previous Thread | Next Thread » |
|
Well this is my first post , on my first day at FN DiBo :P
Here's my problem now . I'm bored of the drawings and stuff like that . Having seen X-Plore v1.30 i thought of this . Is there any way to get the theme as your bg as seen in x-polre . My friend wook suggests it's possible with the appuifw2 module . Can anyone give me the code , how to do it . I've already tried the transparent image on canvas and this is what i get : Code:
Python 2.2.2 (#0, Nov 7 2008, 14:24:30) [C] on symbian_s60
Type "copyright", "credits" or "license" for more information.
Ped 2.30.5 beta
>>> ===== RESTART =====
>>>
E:\Apps-development\Screen shot\Making app\1.py:63: SyntaxWarning: name 'running' is assigned to before global declaration
def quarter():
E:\Apps-development\Screen shot\Making app\1.py:63: SyntaxWarning: name 'running' is assigned to before global declaration
def quarter():
Traceback (most recent call last):
File "ped.py", line 1366, in run_click
File "E:\Apps-development\Screen shot\Making app\1.py", line 140, in ?
quarter()
File "E:\Apps-development\Screen shot\Making app\1.py", line 85, in quarter
canvas.blit(ship, mask=mask)
TypeError: Mask must be an Image object
>>>
With best regards, Aloycasmir |
| aloycasmir |
| View Public Profile |
| Find all posts by aloycasmir |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
|
Quote:
welcome to forum nokia discussion boards. I am not sure about your question but have you checked the TopWindow module in PyS60. Hope it helps you. Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
My question is if we could set appuifw.Canvas as the same as our default theme . http://lonelycatgames.com/picture/xplore/shot5.png something like this . My friend says appuifw2 module can use current theme as bg . Any help with that is really apreciated . BR, Aloycasmir |
| aloycasmir |
| View Public Profile |
| Find all posts by aloycasmir |
|
Only for Text() controls (and Listbox(), which is already themed in regular appuifw). See for yourself: appuifw2.
|
|
ok , i got that
Thanx for your time .Can i ask for help with transparent image on canvas plz ![]() I'm using this currently . Code:
import appuifw
from appuifw import *
import e32
from graphics import *
def quit():
global running
running=0
appuifw.app.set_exit()
appuifw.app.screen='large'
def handle_redraw(rect):
canvas.blit(img)
canvas=appuifw.Canvas(event_callback=None, redraw_callback=handle_redraw)
appuifw.app.body=canvas
app.exit_key_handler=quit
def automask(im):
width, height = im.size
mask = Image.new(im.size, '1') # black and white
tran = im.getpixel((0,0))[0] # transparent top-left
for y in range(height):
line = im.getpixel([(x, y) for x in range(width)])
for x in range(width):
if line[x] == tran:
mask.point((x,y), 0) # mask on the point return mask
from graphics import Image
ship = Image.open('C:\\Data\\Games\\no.gif')
mask = automask(ship)
canvas.blit(ship, mask=mask)
e32.ao_yield()
Best Regards, Aloycasmir |
| aloycasmir |
| View Public Profile |
| Find all posts by aloycasmir |
|
Quote:
There's no Image() object called img in your program. This redraw callback will fail. Quote:
Here's a your program, reworked: Code:
import appuifw
from appuifw import * # Bad style
import e32
from graphics import * # Bad style
def automask(im):
width, height = im.size
mask = Image.new(im.size, '1') # black and white
tran = im.getpixel((0, 0))[0] # transparent top-left
for y in range(height):
line = im.getpixel([(x, y) for x in range(width)])
for x in range(width):
if line[x] == tran:
mask.point((x, y), 0) # mask on the point
return mask
lock = e32.Ao_lock()
def quit():
lock.signal()
ship = Image.open("E:\\ship.png")
mask = automask(ship)
def handle_redraw(rect):
canvas.blit(ship, mask = mask)
canvas = appuifw.Canvas(event_callback = None, redraw_callback = handle_redraw)
appuifw.app.screen = "large"
appuifw.app.body = canvas
app.exit_key_handler = quit
lock.wait()
appuifw.app.set_exit()
|
|
Quote:
Now it's working fine ![]() Extremely gr8-ful to you . Another query if you don't mind . How to trigger a callaback 'x' when gallery key is pushed using keycapture module .Can you plz give me the complete code . Your help is really appreciated . Hope , i'll be able to help forum nokia members soon , when my queries are finished and when my app is ready . tnx a lot jethro ![]() Regards, Aloycasmir |
| aloycasmir |
| View Public Profile |
| Find all posts by aloycasmir |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
As long as I know, we cant capture the gallery key ![]() You can think on using other key, though ![]() BR, Rafael.
Last edited by Rafael T. : 2008-12-18 at 15:13.
|
|
Quote:
![]() I got it ![]() You're wrong bro , certainly , we can capture gallery key You'll see in my upcoming app .Have a good day . If it works fine , i'll even write down the code here ![]() Best regards , Aloycasmir |
| aloycasmir |
| View Public Profile |
| Find all posts by aloycasmir |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
![]() Glad I was wrong, anyway ![]() Just never saw a Python application using this key. Maybe I should have taken a look on the key codes before ![]() Good luck with your application, hope to see it announced here ![]() BR, Rafael. |
|
Quote:
Coz gallery key is one of the least used keys on most phones . Time to put it to use ![]() It'd be an honour if it were announced here too . I.m a symbian-freak developer though (and i believe you're too) ![]() But certainly it'd be better if t.were to be announced here too . I'll be posting gallery key recording code shortly - i.m testing it finally . It seems to be working , even with keypad locked ![]() anyways , do stay tuned , this could prove useful for your app too (i believe i know what you're working on , or were working on) Best regards, Aloycasmir |
| aloycasmir |
| View Public Profile |
| Find all posts by aloycasmir |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
You can announce it here maybe linking to Symbian-Freak article and/or forum if you want
![]() Any code you put here can help many people when they search for that, and maybe avoid some feature questions about the same subject. By the way, I have seen some other Symbian-Freak developers here too, but I'm not one of them ![]() Good luck, Rafael.
Last edited by Rafael T. : 2008-12-19 at 05:07.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem with setFullScreenMode(true) in canvas | mramin05 | Mobile Java Media (Graphics & Sounds) | 6 | 2008-12-06 06:45 |
| canvas...help me plz | chirpylife | Python | 1 | 2008-10-09 22:52 |
| How to create a partly transparent Canvas to lay on top of another Canvas? | mkleijer | Mobile Java Media (Graphics & Sounds) | 4 | 2007-05-22 08:00 |
| Major problem with delegation to Canvas | bartekn | Mobile Java Media (Graphics & Sounds) | 8 | 2003-10-08 18:46 |
| Mercy Mercy plz full canvas makes me thik! | SolaSoly | Mobile Java Tools & SDKs | 0 | 2003-03-28 04:42 |