Preserving quality while zooming out

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
anil
Posts: 16
Joined: Sun Apr 14, 2013 4:12 am

Preserving quality while zooming out

Post by anil » Sun Apr 14, 2013 4:32 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Preserving quality while zooming out

Post by Simon » Sun Apr 14, 2013 5:18 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

anil
Posts: 16
Joined: Sun Apr 14, 2013 4:12 am

Re: Preserving quality while zooming out

Post by anil » Sun Apr 14, 2013 6:21 am

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Preserving quality while zooming out

Post by Simon » Sun Apr 14, 2013 6:58 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

anil
Posts: 16
Joined: Sun Apr 14, 2013 4:12 am

Re: Preserving quality while zooming out

Post by anil » Sun Apr 14, 2013 7:22 am

Thank you Simon... :D

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

anil
Posts: 16
Joined: Sun Apr 14, 2013 4:12 am

Re: Preserving quality while zooming out

Post by anil » Sun Apr 14, 2013 7:25 am

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?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Preserving quality while zooming out

Post by Simon » Sun Apr 14, 2013 7:39 am

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.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

snm
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 253
Joined: Fri Dec 09, 2011 11:17 am

Re: Preserving quality while zooming out

Post by snm » Sun Apr 14, 2013 7:56 am

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Preserving quality while zooming out

Post by Simon » Sun Apr 14, 2013 8:09 am

Marek,
Great, yes much better!

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

anil
Posts: 16
Joined: Sun Apr 14, 2013 4:12 am

Re: Preserving quality while zooming out

Post by anil » Sun Apr 14, 2013 8:15 am

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Preserving quality while zooming out

Post by Simon » Sun Apr 14, 2013 8:37 am

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.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

anil
Posts: 16
Joined: Sun Apr 14, 2013 4:12 am

Re: Preserving quality while zooming out

Post by anil » Sun Apr 14, 2013 5:11 pm

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

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Preserving quality while zooming out

Post by Simon » Sun Apr 14, 2013 9:30 pm

Hi anil,
That is also covered in the beginner course.
Have you gone through all the video lessons?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply