Hi,

I'm writing in python for s60 (nokia cell.) and working with Canvas and Image,
while i'm moving through the image using:

canvas.blit(image, source=((sourceLocX, self.sourceLocY),
(sourceLocX+ canvas.size[0],
sourceLocY+self.canvas.size[1])))

i can't seems to zoom in/out, I looked into Image and Canvas documentation and still don't
understand how to do that...
anyone knows ?


Best,
PapaJ

It looks like you are simply blit-ing from the source to the destination at the same size. You'll need to rescale the image first. When you say you are using Canvas and Image, are you referring to Image from the PIL library?

Jeff

It looks like you are simply blit-ing from the source to the destination at the same size. You'll need to rescale the image first. When you say you are using Canvas and Image, are you referring to Image from the PIL library?

Jeff

Hi Jeff,

thanks for the reply,

this is the code for initilizing the objects:

img = Image.open(self.map)
canvas=appuifw.Canvas(event_callback=self.keyboard.handle_event, redraw_callback=self.onRedraw) 
appuifw.app.body = canvas

these are the imports:

from appuifw import *
from graphics import *
import urllib
import sysinfo

so I'm not sure if the PIL library contained in one of these (I'm quite new to python..)
assuming the Image is from the PIL
does

canvas.blit(image.Rescale(img.GetWidth() * 2, img.GetHeight() * 2)), source=((sourceLocX, self.sourceLocY),(sourceLocX+ D1,sourceLocY+ D2)))

will do the trick ?

Best,
Papaj

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.