Split image into clickable sections

Hi, I was wondering if anyone know how to split an image into several clickable sections. I am trying to make the game "Risk", and I am sort of stuck at this problem. I have been thinking of making an individual image button for every country with the respective country as image, but I hope there is a better way to do this. The best would be to just split the world map into country sections.
Thank you in advance
OhM

A naive (but possibly sufficient) implementation could just be to keep a table mapping (x,y) pairs to countries. To keep the table smaller, you could map 10x10 blocks of pixels to countries.
Ultimately this is about storing and then managing data.
One hack (in my opinion) is to check the color of the clicked pixel in the image of the map. But that is nasty for a variety of reasons (such as, it keeps you from being able to easily change the map image, and things like text in the map (like the names of countries) kind of screws that up. But it's an option.
You can also keep lists of pixels in sequence describing a polygon, and then use certain algorithms (which I don't recall right now) to determine whether a given point is inside or outside a given polygon.
Also you can do things like "binary space partitions", I think.
These last two things are computer graphics techniques, and are non-trivial to implement. I dimly recall them from college but recall no details. You can get a computer graphics textbook (which tend to be expensive) to get more info, or these days there's probably a wiki about it somewhere.
But I'd suggest keeping it modular. Add a layer of abstraction, writing an API around this functionality. Then write an implementation with a simple table of locations or blocks of locations, and if this proves to be insufficient later, swap it out with something more sophisticated.

Similar Messages

  • How to split image into smaller (same size) pieces?

    Hi all,
    My question is how to split image into smaller (same size) pieces, using Photoshop elements 13? Could anyone help me with this one?
    Thanks!

    Use the Expert tab in Editor (I think that is what it is called in PSEv.13)
    You may find the grid helpful. Go to View>Grid. It will not print, but will help to orient you. You can set up the gridlines to suit via Edit>Preferences>Guides and Grid. If you want to partition the picture in to 4 uniform pieces, it would be Gridline every 50%, Subdivision 1. Also, go to View>Snap to>Grid.
    Set up the Rectangular marquee tool: If the picture is 6" wide & 4" high, enter width=3in & height=2in.on the tool's option bar. This will be a fixed size.
    Click and select one quadrant, press CTRL+J to place this quadrant on a separate layer
    Repeat for the other 3 quadrants
    You should end up with 5 layers : Background, and layers 1, 2, 3, 4.

  • Make a large image into smaller slices

    is there a way of splitting a large image into smaller
    sections

    wilburforce wrote:
    > is there a way of splitting a large image into smaller
    sections
    Check the help files on slicing. If you mean within the
    document window,
    use the marquee selection tools.
    Linda Rathgeber [PVII] *Adobe Community Expert-Fireworks*
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    Design Aid Kits:
    http://www.webdevbiz.com/pwf/index.cfm

  • HT1040 I have a full page photo in a iPhoto book that is splitting into two sections across 2 pages. Any ideas what the problem might be?

    I have a full page photo in a iPhoto book that is splitting into two sections across 2 pages. Any ideas what the problem might be?

    Have you selected the spread layout?
    If so change it to a single page full page layout
    LN

  • How to split this string into 4 sections to a max 35 characters

    Hello,
    Does anyone have an idea how I can acheive this please.
    I have this string
    Expense_Inv_8- ExpenseInv_7- Exp001- Expense_Inv_6- Expense_Inv_5- Expense_Inv_4- Expense_Inv_3- Expense_Inv_2- Expense_inv1
    and I need to display them in sections seperated by ';' as explained below
    Section 1 Section 2 Section 3 Section 4
    Expense_Inv_8- ExpenseInv_7- Exp001;Expense_Inv_6- Expense_Inv_5;Expense_Inv_4- Expense_Inv_3;Expense_Inv_2;
    need to split this string into 4 sections seperated by ';' and each section should be of no more than 35 characters, if null should end ;;;
    Section 1, 35 Character ended by;
    Section 2, broken off after Expense_Inv_5 because Expense_Inv_4 will take it over 35 chracters)
    Section 3, should only take Expense_Inv_4- Expense_Inv_3, because adding Expense_Inv_2 will take it over 35
    characters, each record in the string is seperated by '-'
    Section 4, dispays the reminder of the string
    regards
    Ade

    Hi,
    Welcome to the forum!
    Whenever you ask a question, it helps if you post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) and the results you want from that data.
    I think I understand the problemk well enough to attempt a solution, but if the query below isn't right, please post that information.
    WITH     cntr     AS
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL     <= ( SELECT  MAX (LENGTH (txt))
                             FROM    table_x
    ,     got_best_path     AS
         SELECT     id
         ,     txt
         ,     MAX ( SYS_CONNECT_BY_PATH ( TO_CHAR (c.n, '99')
                      ) AS best_path
         FROM     cntr     c
         JOIN     table_x     x     ON     c.n <= LENGTH (x.txt)
         START WITH     c.n     = 1
         CONNECT BY     c.n - PRIOR c.n     BETWEEN  1
                                 AND      :section_length
              AND     x.id          = PRIOR     x.id
              AND     SUBSTR ( x.txt
                                 , c.n
                                 , 1
                                 )     = '-'
         AND     LEVEL          <= :section_cnt
         GROUP BY  id
         ,            txt
    ,     got_pos     AS
         SELECT     id
         ,     REPLACE ( txt
                   ) || ';'                         AS txt
         ,     best_path
         ,     TO_NUMBER (REGEXP_SUBSTR (best_path, '[0-9]+', 1, 2))     AS pos_2
         ,     TO_NUMBER (REGEXP_SUBSTR (best_path, '[0-9]+', 1, 3))     AS pos_3
         ,     TO_NUMBER (REGEXP_SUBSTR (best_path, '[0-9]+', 1, 4))     AS pos_4
         FROM     got_best_path
    SELECT  id
    ,     SUBSTR (txt,     1    , NVL ( pos_2         , :section_length))     AS section_1
    ,     SUBSTR (txt, pos_2 + 1, NVL ((pos_3 - pos_2), :section_length))     AS section_2
    ,     SUBSTR (txt, pos_3 + 1, NVL ((pos_4 - pos_3), :section_length))     AS section_3
    ,     SUBSTR (txt, pos_4 + 1,                        :section_length )     AS section_4
    FROM     got_pos
    ;As written, this requires SQL*Plus 9 (or higher). You can have multiple versions or SQL*Plus on the same client, if you really need to keep the older version.
    :section_length is the maximum length of each section (35, as you stated the problem).
    :section_cnt is the number of sections. In the query above, this is 4. If you change it, you not only have to change the bind variable, but you have to change the hard-coded SELECT clauses of the main query and the last sub-query (that is, got_pos).
    MODEL or PL/SQL would probably be better ways to solve this problem.

  • Split an image into average small blocks

    Hi Guys:
    Is there any easy way for me to Split an image into average small blocks ? like following , i don't want to get the size of the entire image , and computer the x,y,hight,wight for every blocks , then use image extract

    Hi Abodefree,
    How many averaged blocks do you need? What size of block (in pixels) are you looking for?
    In genersal terms, what is your application -- why do you require the averaged blocks? Are you looking for the brightest quadrant (for example)? 
    Depending on your application, a convolution filter might be useful...
    -- Dave
    www.movimed.com - Custom Imaging Solutions

  • Keyboard my keyboard has split into two sections? How can I restore it?

    My key board has split into two sections, not sure how I did it but can I restore it ?

    From the iPad User Guide (tap to enlarge):

  • Script to split pdf into sections

    Hello
    I have an awful lot of books in pdf format
    I now have to be able to split them into their chapters, I'm assuming I'll have to make a text file up for each book to tell the script where each chapter starts
    I've done some scripting in Indesign and Quark on the Mac OS X but am yet to do anything in Acrobat, I'd want something that could loop through the list of page numbers for each chapter start and extract each chapter as a seperate pdf
    I'd be grateful for pointers to anything useful, I've found bit and bobs with google but nothing that useful so far
    I'm decent at canablising, hpeless working from scratch
    Thanks
    Tynan

    Use the extractPages document method: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.465.html

  • Wall decals over size.. functionality to cut image into piece on artboard ?

    1- I am doing wall decals, I am drawing a big tree (7 foot long). My vinyl roll size in 24 inches. Is there a functionality in Adobe Illustrator CS5.5 to split the image into section ready to cut ? My cutting software can do it but I want to do it in illustrator... is there a way ???
    2- I am not able to find information on how illustrator can help me to place the objects on the artboard (with spaces between each objects) to maximize the vinyl space available without have to place each object by hand one by one.
    Thanks Nancy

    This kind of stuff (vinyl cutting project setup) was a pain to do in Illustrator prior to its finally (literally decades late to the game) acquiring the ability to have more than one page in a file. It's still a pain comparitive to Adobe's other vector drawing program (FreeHand), due to Illustrator's still-yet-to-appear ability to draw to user-defined scale.
    This is how I routinely do it in FreeHand:
    1. Draw the whole design at a comfortable scale (ex: 1"=1') on a convenient page size (ex: tabloid, so I can print it on a desktop printer). Define spot color Swatches for each vinyl.
    2. When the design is done, add pages (one for each vinyl to be used) with either height or width the actual width of my vinyl (ex: 24"). Set ruler guides on each page to indicate what I consider a comfortable "maximum cut width" for the gripper/roller margin of my machine.
    3. Select all elements of a single vinyl color, duplicate them to one of the full-size pages. Do this for each vinyl.
    4. Scale the elements to actual size (ex: 1200%).
    5. For an element too large for the maximum cut width, place a pair of ruler guides separated by the amount of desired overlap (ex: .25").
    6. Duplicate the object in place. Use the Knife tool to slice the object along one of the guides. Delete the unwanted piece.
    7. Similarly cut the remaining (original) copy along the other guide. Delete the unwanted piece.
    8. Freely arrange (move and/or rotate) each of the pieces so as to maximize vinyl usage on each vinyl-specific page. Drag length of vinyl pages to fit final arrangement.
    9. Export the full-size pages only.
    10. Open the exports in my cutter driver software, and cut.
    I leave it to you to translate the same basic operations to Illustrator. Some of the reasons I still find Illustrator inferior for this:
    Still no support for user-defined ruler scales.
    Very unreliable snaps behavior at zooms.
    The infernal "Global" swatch designation.
    Pages interface (like many things) needlessly cumbersome compared to FreeHand's. (Separate "Artboard mode" is tedious for arranging Artboards, making page-specific guides, snapping Artboards to grid and to each other.)
    Inferior behaviors of Boolean path operations ("Pathfinders"). (Ex: converting compound paths to groups.)
    Inferior cutting tools (Ex: releasing compound of compound paths; failure to handle open, unfilled paths.)
    JET

  • Loading Images into Applets

    I've been having problems loading an image into an Applet. I've found that when the getImage() call is put into the init() method it loads the image fine, also implementing an imageUpdate call. However, now I'm trying to expand on this by putting it into a button click, it hangs indefinitely while waiting for the image to load.
    Another interesting point I've noticed is that the Canvas subclass ImageSegmentSelector uses a PixelGrabber in its constructor to put the Image into a buffer - when this class is created from the imageUpdate() call, NOT the init() call, the grabPixels() call hangs indefinitely too!!
    Any feedback, please,
    Jonathan Pendrous
    import java.applet.*;
    import java.net.*;
    import jmpendrous.util.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.awt.event.*;
    public class XplaneGlobalSceneryDownloader extends Applet implements ActionListener{
    ImageSegmentSelector worldMap;
    Image img;
    URL url;
    int longtitude = 36;
    int latitude = 18;
    boolean imageLoaded;
    TextField t1, t2,t3;
    Label l1,l2,l3;
    Button b1;
    Applet a1;
    public void init() {
    a1 = this;
    l1 = (Label) add(new Label("Number of horizontal sections: "));
    t1 = (TextField) add(new TextField("45",3));
    l2 = (Label) add(new Label("Number of vertical sections: "));
    t2 = (TextField) add(new TextField("45",3));
    l3 = (Label) add(new Label("URL of image file: "));
    t3 = (TextField) add(new TextField("file:///C:/java/work/xplane_project/source/world-landuse.GIF",60));
    b1 = (Button) add(new Button("Load image"));
    b1.addActionListener(this);
    validate();
    // THIS CODE WORKS FINE ...
    /*try { url = new URL("file:///C:/java/work/xplane_project/source/world-landuse.GIF"); }
    catch(MalformedURLException e) { System.exit(0);   }
    img = getImage(url);
    //int w=img.getWidth(this);
    while(imageLoaded==false) { try { Thread.sleep(1000);   } catch(InterruptedException e) {System.exit(0);    } }
    worldMap = new ImageSegmentSelector(this, img, longtitude, latitude);
    add(worldMap);
    //resize(worldMap.getWidth(), worldMap.getHeight());
    validate();*/
    //repaint();
    //worldMap = new ImageSegmentSelector(this, img, longtitude, latitude);
    //repaint();
    public void actionPerformed(ActionEvent e) {
    try { longtitude = Integer.parseInt(t1.getText()); } catch (NumberFormatException ex) {System.exit(0); }
    try { latitude = Integer.parseInt(t2.getText()); } catch (NumberFormatException e2) {System.exit(0); }
    try { url = new URL(t3.getText()); }
    catch(MalformedURLException e3) { System.exit(0);   }
    img = getImage(url);
    //int w=img.getWidth(this);
    while(imageLoaded==false)
    { try { Thread.sleep(1000);   } //KEEPS ON LOOPING
    catch(InterruptedException e4) {System.exit(0);    } }
    worldMap = new ImageSegmentSelector(a1, img, longtitude, latitude);
    add(worldMap);
    //resize(worldMap.getWidth(), worldMap.getHeight());
    validate();
    public boolean imageUpdate(Image i, int flags, int x, int y, int w, int h){
    // THIS NEVER GETS CALLED AT ALL //
    if (((flags & ImageObserver.WIDTH) != 0) && ((flags & ImageObserver.HEIGHT) != 0)) {
    //worldMap = new ImageSegmentSelector(this, i, longtitude, latitude);
    //add(worldMap);
    //validate();
    //repaint();
    imageLoaded = true;
    return false;
    return true;
    }

    Sorry, thought this had been lost.
    You can load a file if the applet itself is run from the local filesystem - it loads it fine from the init(), but not otherwise. But I haven't got the applet to run from a browser yet without crashing (it's OK in the IDE debugger), so that's the next step.

  • Why can't I insert an image into the header in Pages 5.0.1?

    In previouis versions of Pages, I was able to insert an image into a Header or Footer.
    This action does not appear an option in Pages 5.0.1.
    Am I missing something?
    I must say, I do not like the NEW interface. Much has been lost with the transition to the Cloud.
    I like the concept of using my iPad Air and my desktop, however functionality has been tossed out for deference to the Tablet.

    KT,
    Use a "Floating Graphic" and send it to the Section Master in the Arrange > Section Master menu. Floating is called Stays With Page now. Don't worry about it not being in the Header field. It will serve the purpose.
    Jerry

  • How do I get images into the "images" folder with Dreamweaver CS4?

    Hi,
    I've been following the tutorial by Christopher Heng, on chapter 2, adding images. "Look at the right panel of the web editor. You should see at least two major sections: the top section has a tab entitled "INSERT", and the bottom section has a tab labelled "FILES""...
    I don't see the tab "Insert", but do see "Files" and have created a folder in there called "Images", as Mr. Heng explained.
    The next step sounds easy enough - copy your image files into the images folder.  But for the life of me I can't seem to do this. Can someone PLEASE help me out?
    Thank you - Louise

    Do you mean you can't get your images into the images folder of your site?
    Open the folder with your images in it on the desktop,
    not inside dreamweaver,
    and open the folder you want to put the images on your desktop too,
    so both folders are open,
    right click the image, copy and paste it to your website images folder
    or double-click the image and drag it across into the website images folder.
    You could also open the image in your image editing software and 'save as'
    then browse to your website images folder and save there.
    Daniel

  • Can't Copy Image Into Textedit

    This might be a coincidence but then maybe not... ever since I've installed MacOSX 8, I can no longer drag images or copy/paste images into TextEdit docs.
    Is there a TextEdit section here?
    Anyway,
    Logging in as a different user does not help.
    Trashing the TextEdit plist does not solve the problem...
    Any ides on what could be preventing this? Thanks!

    And 'deny network-outbound' messages. Sometimes I was dragging an image off a web page into a textedit to troubleshoot and sometimes from an image all ready on my computer.
    TextEdit(1857) deny network-outbound 173.192.108.232:80
    Process:         TextEdit [1857]
    Path:            /Applications/TextEdit.app/Contents/MacOS/TextEdit
    Load Address:    0x103f2c000
    Identifier:      com.apple.TextEdit
    Version:         301 (1.8)
    Build Info:      167-TextEdit~301000000000000
    Code Type:       x86_64 (Native)
    Parent Process:  launchd [240]
    Date/Time:       2013-03-19 12:40:37.441 -0500
    OS Version:      Mac OS X 10.8.3 (12D78)
    Report Version:  8
    Thread 0:
    0   libsystem_kernel.dylib            0x00007fff8c2d8a86 __connect + 10
    1   libsystem_network.dylib           0x00007fff96755960 tcp_connection_destination_start + 749
    2   libsystem_network.dylib           0x00007fff9675550b tcp_connection_start_next_destination + 62
    3   libsystem_network.dylib           0x00007fff967551ec tcp_connection_host_resolve_result + 1844
    4   libsystem_dnssd.dylib             0x00007fff90442401 handle_addrinfo_response + 446
    5   libsystem_dnssd.dylib             0x00007fff90440902 DNSServiceProcessResult + 673
    6   libdispatch.dylib                 0x00007fff8c2770b6 _dispatch_client_callout + 8
    7   libdispatch.dylib                 0x00007fff8c27929b _dispatch_source_invoke + 691
    8   libdispatch.dylib                 0x00007fff8c278305 _dispatch_queue_invoke + 72
    9   libdispatch.dylib                 0x00007fff8c278448 _dispatch_queue_drain + 180
    10  libdispatch.dylib                 0x00007fff8c2782f1 _dispatch_queue_invoke + 52
    11  libdispatch.dylib                 0x00007fff8c2781c3 _dispatch_worker_thread2 + 249
    12  libsystem_c.dylib                 0x00007fff9061ad0b _pthread_wqthread + 404
    13  libsystem_c.dylib                 0x00007fff906051d1 start_wqthread + 13
    Binary Images:
        0x7fff8c275000 -     0x7fff8c28aff7  libdispatch.dylib (228.23) <D26996BF-FC57-39EB-8829-F63585561E09> /usr/lib/system/libdispatch.dylib
        0x7fff8c2c7000 -     0x7fff8c2e2ff7  libsystem_kernel.dylib (2050.22.13) <5A961E2A-CFB8-362B-BC43-122704AEB047> /usr/lib/system/libsystem_kernel.dylib
        0x7fff9043f000 -     0x7fff90447ff7  libsystem_dnssd.dylib (379.37) <616FC901-151E-38BF-B2C4-24A351C5FAAD> /usr/lib/system/libsystem_dnssd.dylib
        0x7fff90604000 -     0x7fff906d0ff7  libsystem_c.dylib (825.26) <4C9EB006-FE1F-3F8F-8074-DFD94CF2CE7B> /usr/lib/system/libsystem_c.dylib
        0x7fff96750000 -     0x7fff9675eff7  libsystem_network.dylib (77.10) <0D99F24E-56FE-380F-B81B-4A4C630EE587> /usr/lib/system/libsystem_network.dylib

  • Inserting Image into BLOB field from URL

    Is it possible to insert an image into a BLOB field from a URL? I don't have access to the filesystem on the server and I have a page that uses PL/PDF to generate dynamic PDF files from data I pull from the database. I would like to include my companies official header with logo on the top of the PDFs I generate and need to somehow get the image which I currently have uploaded to the images section in Application Express and can access from the "Shared Components => Images" section of the Application Builder. I just want to be able to either query whatever table holds those images or copy the image I need to a blob field in one of my tables so I can use it in my PDF document.
    The other alternative (which is what I first mentioned above) would be to try and perform an insert into the BLOB field in my table but the location of the image file would be like "http://www.myportal.com:7777/pls/htmldb/wwv_flow_file_mgr.get_file?p_security_group_id=1234567&p_flow_id=111&p_fname=myimage.jpg".
    Is this possible? If not, what can I do?
    Thanks in advance.

    The reason why I am asking this question in this forum is two-fold:
    1. I am using Application Express (AE).
    2. Since I am using AE all images that I upload to my workspace are stored in a table in a database and not as an actual file in a directory structure like in Windows etc. This being the case, I can't ever reference any of the files that I upload to my workspace in order to insert them into my BLOB field unless I know their physical location on disk (which of course does not exist b/c they are stored in the AE database somewhere). If I knew AE's database and table structure I could do a "select into ..." from whatever table stores my uploaded images and save those images to my own custom table in my BLOB field.

  • When I drag an image into IBA, it rotates 90 degrees.

    I'm having trouble dragging a particular image into iBooks Author.  I took a picture and imported from my camera to iPhoto.  The image had to be rotated 90 degrees, which I did in iPhoto.  I'm using the "Contemporary" template in iBooks Author and I'm trying to drag my image from iPhoto to replace the red, space themed image at the top of a section page.  When I do so, the image reverts to its original instead of the rotated form.  I can't figure out how to rotate the image without rotating the mask.

    Hello Abram1,
    Not sure of the reasons but I would imaging it might have to do with iPhoto and its non destruction approach to editing.
    Have you tried exporting the image out as a new image that would then have the new rotation that you wish applied to it.
    I hope this helps,
    Regards,
    Nigel

Maybe you are looking for