Page 1 of 1

Preserving quality while zooming out

Posted: Sun Apr 14, 2013 4:32 am
by anil
hello there!
i am trying to make a image gallery with few images,which has next and previous buttons.
i want my images to be zoomed out and zoom in so that
they are not blurred,distorted.also what is the best image format,resolution for android development

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 5:18 am
by Simon
Hi anil,
Welcome to the forum!
For now I think that you are safe with a landscape width of 2048 px for your images, I don't know of android devices that have larger screens than that but I could be wrong. Just use a jpeg image, it's fine.

Simon

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 6:21 am
by anil
Thanx Mr. simon!

i am also trying to find out the "zoom in and zoom out for images" functionality in android development.
what could be the possible way of zooming image while tapping it?

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 6:58 am
by Simon
Hi anil,
It's just Simon. :)
This should get you going:

Code: Select all

local doZoom
on mouseDown
   put true into doZoom
   zoomIn
end mouseDown

on mouseUp
   put false into doZoom
end mouseUp

on zoomIn
   repeat with x = 1 to 100
       if doZoom = false then exit repeat
      put the loc of img "myImage" into tLocate
      set the width of img "myImage" to the formattedwidth of img "myImage" * x/50 --adjust the width
      set the height of img "myImage" to the formattedheight of img "myImage" * x/50 --adjust the height
      set the loc of img "myImage" to tLocate
      wait 100 millisecs with messages
   end repeat
end zoomIn
Note:
1) that this should be placed in a button
2) this only zooms in (it's what you asked for)
3) this might not be the best way
4) have fun changing this code to suit your needs, you should be able to figure out the zoom out :D

Not sure how just tapping on the screen you can do this because you need zoom out.
Unless you know of an un-tapping feature :D

Simon

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 7:22 am
by anil
Thank you Simon... :D

Code worked for me for zoom in and zoom out..:)

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 7:25 am
by anil
Do we need to specify the size of each object according to screen resolution of android devices?
Or the same code can be used?if it is then how to specify the size of objects?
Do we need to have different resolution images and different sizes for different screen resolution?

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 7:39 am
by Simon
Here check this out:
http://lessons.runrev.com/m/4069
Displaying Assets On Differing Screen Resolutions
and here:
http://runrev.com/developers/documentat ... rs-course/
You should look at all the vids there but it's lesson 4 you want.

Simon
Edit: if they don't say it in either of those look up "screenRect" in the dictionary.

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 7:56 am
by snm
Little optimalization of above code - put

Code: Select all

if doZoom = false then exit zoomIn
before repeat loop. There is no need to check it 100 times.

Marek

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 8:09 am
by Simon
Marek,
Great, yes much better!

Simon

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 8:15 am
by anil
i am trying to create a introduction of people gall3ry.each page contains a image , some description,previous and next button.
i want transition takes place like slider,i mean transition should be shown like sliding.

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 8:37 am
by Simon
That is in lesson 2 of the beginners course.
add "visual effect" to the "go card" part.

Simon
Edit: actually if you go through all the lessons it shows you the slide as well.

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 5:11 pm
by anil
when i changes the stack size,background size does not changes.how to change it?

I have a card having some objects like button,label and images etc .when opening into different device,
how to adjust their size and relative position
according to devices

Re: Preserving quality while zooming out

Posted: Sun Apr 14, 2013 9:30 pm
by Simon
Hi anil,
That is also covered in the beginner course.
Have you gone through all the video lessons?

Simon