best people, i have a question, i want first resize the image, then change the canvas size of image(150x150),
my code:
[code]local demo_pic = display.newImage(“d.jpg”)
function resize( event )
local g = event.target
if g.width < g.height then
g:scale(150/g.width, 150/g.width)
g.height = g.width
elseif g.width > g.height then
g:scale(150/g.height, 150/g.height)
g.width = g.height
elseif g.width == g.height then
g:scale(150/g.height, 150/g.height)
g.width = g.height
end
end
demo_pic:addEventListener(“tap”, resize)[/code]
but works different, look:
that works nice with version 704, but not version 828, somebody know why? [import]uid: 38153 topic_id: 27366 reply_id: 327366[/import]