Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pop up some part image in android

i want to display the some part of image.like a comic book.i have one image like this.

this is actual image.

when i click on image some part display like this.

Second image when click this part of image.

i want to display this type. in this process i create some zip file witch contain the part of images of main image. i done to display every image sequence wise.but my problem is how to get the actual image's any part click and display this in like second screen?

i can't get the image part id. so how to get this part of image id.

so please help me. i am stuck.

like image 267
Zala Janaksinh Avatar asked Dec 17 '12 06:12

Zala Janaksinh


1 Answers

If you have archive with parts of main image, so that means you made them manually, right? So, your comics book viewer will be applicable only for manually created content.

It it's true, so there is no trouble to make some kind of config-file (for example xml-based or Properties file) which will contain size and position for each part.

After that you can handle MotionEvent and detect id of part by coordinates from config.

You also can improve your application by cutting images on-fly. It's not difficult.

Example:

Your image here (page1.png):

--------------------------------
|                 |            |
|                 |            |
|                 |     2      |
|        1        |            |
|                 |            |
|                 |------------|
|                 |            |
|-----------------|            |
|                 |     4      |
|                 |            |
|                 |            |
|                 |------------|
|        3        |            |
|                 |            |
|                 |     5      |
|                 |            |
|                 |            |
--------------------------------

Your simple config (page1.cfg):

# Parts description
# id=x,y;w,h
1=0,0;18,9
2=19,0;13,7
3=0,10;18,11
4=19,8;13,7
5=19,15;13,6

Your zip:

page1.png
page1-1.png
page1-2.png
page1-3.png
page1-4.png
page1-5.png
page1.cfg
...
like image 100
Oleksii K. Avatar answered Sep 30 '22 19:09

Oleksii K.