| Reply | « Previous Thread | Next Thread » |
|
Hi:
My app uses the whole canvas. I was using large mode and drawing was OK. But when I use full_max mode I'm noticing the lower part of the screen is not being drawn by the app, like if the reported vertical canvas size was smaller than the actual dimensions. To use the full canvas I'm adding 153 to the vertical size. I'm assuming somebody already came across this. Can someone confirm 153 is the correct value ? Thanks. |
|
Screen size returned by canvas.size should work as is. You can check out the scribble example, available under extras\Scribble in the PyS60 source package.
|
| mahesh.sayibabu |
| View Public Profile |
| Find all posts by mahesh.sayibabu |
|
I've used full_max in 5800 with 1.9.5 without any problems. Maybe you could write a minimal test application to check, if you have size problems always or only in your app.
If it's your app, then you might have to check if there's something special in your app which might cause this. Maybe your screen update routines are hardcoded to smaller size, maybe you change screen size during execution of application? Cheers, --jouni |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
HI
I having using canvas without problems in XM 5800. However, due to bugs in my applications I was forced to put some debug routine inside resize callback and it was possible to see that canvas was resized one or two times when you the program went from normal to full_max (with different sizes at each call). This way, canvas size will change. Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
|
I'm still having problems.
I wrote a very small program for testing and it's giving me the correct values: normal 360,487 large 360,579 full 360,579 full_max 360,640 However, in my application I'm getting normal 360,487 large 360,579 full 360,579 full_max 360,487 I'm using this code Code:
appuifw.app.screen='full_max'
self.o_Canvas = appuifw.Canvas(redraw_callback = self.v_Redraw)
# Get horizontal and vertical dimensions
self.t_CanvasSize = (self.o_Canvas.size[0], self.o_Canvas.size[1])
self.v_Print(str(self.t_CanvasSize[0])+ " " + str(self.t_CanvasSize[1]) + appuifw.app.screen)
The v_Print ouputs a string to screen at a fixed position. Output is buffered, so it's still valid to write to the screen at this point (before creating the Draw object). Any additional ideas are welcome. |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
Carlos, what I was trying to tell you is the following: you have two resize events on canvas before reaching full size. And if you use size() before the last event, it is smaller. You need to handle resize callback. Please, take a look in the following program:
Code:
from appuifw import *
import e32
import graphics
cv = None
f = open('e:\\szcanvas.txt','wt')
def resize_canvas(sz):
global f
global cv
f.write('size: %d,%d\r\n'%sz)
if cv:
f.write('b) canvas size: %d,%d\r\n'%cv.size)
f.flush()
lock = e32.Ao_lock()
app.menu = [(u"Quit", lambda: lock.signal())]
app.screen = "full_max"
cv = Canvas(resize_callback=resize_canvas)
f.write('a) canvas size: %d,%d\r\n'%cv.size)
app.body = cv
lock.wait()
f.close()
Code:
size: 360,487 a) canvas size: 360,487 size: 360,640 b) canvas size: 360,640 Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
|
Thanks Marcelo. I see your code and understand what you're saying, but I don't see why or when is the resize callback actually called.
Also, you mention the callbacks needs to be called two times, but I see it's only called once (when printing "b) .... " Another question: Is this behavior actually a bug? One more thing... In my original code I now tried assigning the Canvas to the application body before (not after) asking for canvas size and the correct dimensions are now returned: Code:
# Create full size canvas
appuifw.app.screen='full_max'
self.o_Canvas = appuifw.Canvas(redraw_callback = self.v_Redraw)
appuifw.app.body=self.o_Canvas
# Set horizontal and vertical dimensions
self.t_CanvasSize = (self.o_Canvas.size[0], self.o_Canvas.size[1])
self.v_Print(str(self.t_CanvasSize[0])+ " " + str(self.t_CanvasSize[1]) + appuifw.app.screen)
Does the assignment actually call the callback??? Or it's that probably the correct way to do it? |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|||
|
Hello
It seems we are approaching to a conclusion here ! Quote:
Quote:
Strange, I know. But I need to check the buffer in resize events. All coded I did it was necessary. Quote:
Since I want to handle screen rotations, I decided to receive resize callbacks and I allocated a large screen buffer, like: Code:
sz = max(sysinfo.display_pixels()) self.scr_buf = graphics.Image.new((sz,sz)) Code:
self.canvas.blit(self.scr_buf) Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
|
Muito obrigado, Marcelo!
(I hope I said that right :-) ) |
|
Join Date: Nov 2007
Posts: 318
Location: Sertaozinho/Brazil
marcelobarrosalmeida
Offline
Forum Nokia Champion
|
|
De nada !
(It is perfect ! )Marcelo Barros Nokia E71, N800, N95 and XM 5800 http://www.croozeus.com http://wordmobi.wordpress.com http://jedizone.wordpress.com |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Canvas size in 7210 | Griffel | Mobile Java General | 3 | 2003-04-29 21:56 |
| microedition.platform and canvas size for Nokia 3510i | LiamQ | Mobile Java General | 1 | 2002-10-22 12:08 |
| 6310i Emulator Canvas Size. | fmhunter | Mobile Java Tools & SDKs | 1 | 2002-07-23 11:38 |
| Change the paintable canvas size of the emulator | Nokia_Archived | Mobile Java Tools & SDKs | 1 | 2002-05-17 19:07 |
| canvas size | topisystems | Mobile Java General | 2 | 2002-05-15 13:28 |