Creating Image Maps

Discussion in 'Python' started by Aaron, Dec 24, 2004.

  1. Aaron

    Aaron Guest

    I know this is a thing used primarily on websites..but since python can do
    anything ;)

    I'm trying to make a clickable image map for my wxPython program.
    Basically, I know how to organize the images into one large image in a
    panel, but how do I make the individual pieces clickable like webpage
    links(in wxPython)? The goal is to add an event handler that displays the
    image piece in a different panel, along with attributes. Which I could do
    if only I could make the pieces clickable

    Any ideas?

    Also, if you have any hard to find links on the general area I'm talking
    about, I'd like to learn as much as possible.

    -thanks
     
    Aaron, Dec 24, 2004
    #1
    1. Advertising

  2. Aaron

    M.E.Farmer Guest

    Hello Aaron,
    You need to check the demo that comes with wxPython if you don't
    have it get it. Look under wxHtmlWindow and click the demo tab then
    just scroll down and there is a link to it that says IMAGEMAP.
    Or in other words RTFD ;)
    M.E.Farmer
     
    M.E.Farmer, Dec 24, 2004
    #2
    1. Advertising

  3. Aaron

    Steve Holden Guest

    Aaron wrote:

    > I know this is a thing used primarily on websites..but since python can do
    > anything ;)
    >
    > I'm trying to make a clickable image map for my wxPython program.
    > Basically, I know how to organize the images into one large image in a
    > panel, but how do I make the individual pieces clickable like webpage
    > links(in wxPython)? The goal is to add an event handler that displays the
    > image piece in a different panel, along with attributes. Which I could do
    > if only I could make the pieces clickable
    >
    > Any ideas?
    >
    > Also, if you have any hard to find links on the general area I'm talking
    > about, I'd like to learn as much as possible.
    >

    Basically, your approach can be completely different under wxPython -
    you can use a single image, and then query the mouse click events to
    determine which location (and therefore which portion of the image) was
    clicked.

    You *could* use separate images as well, in which case you would need to
    provide callback functions to be called for clicks on the various
    sub-portions.

    Take a look at the docs for wxEvent, and see if that leads you to
    something you can understand.

    regards
    Steve
    --
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/
    Holden Web LLC +1 703 861 4237 +1 800 494 3119
     
    Steve Holden, Dec 24, 2004
    #3
  4. Aaron

    Aaron Guest

    Thanks for the responses guys!

    The first option you provided sounds great, Steve. I think I'm gonna try
    it that way.
     
    Aaron, Dec 25, 2004
    #4
  5. Aaron

    Steve Holden Guest

    Aaron wrote:

    > Thanks for the responses guys!
    >
    > The first option you provided sounds great, Steve. I think I'm gonna try
    > it that way.
    >

    OK. It's usually the easiest way if the subsections are at all regular.
    If they are irregular it's often the *only* way!

    This is a technique that can also be used on the web (Google for
    "client-side image map"), but it's very little-used there.

    regards
    Steve
    --
    Steve Holden http://www.holdenweb.com/
    Python Web Programming http://pydish.holdenweb.com/
    Holden Web LLC +1 703 861 4237 +1 800 494 3119
     
    Steve Holden, Dec 27, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Vaughn

    GDI+ and Image Maps

    Kevin Vaughn, Jul 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    437
    Kevin Vaughn
    Jul 11, 2003
  2. chaos/dollheads

    Image maps and shopping carts

    chaos/dollheads, Jul 5, 2003, in forum: HTML
    Replies:
    0
    Views:
    418
    chaos/dollheads
    Jul 5, 2003
  3. Paul F. Johnson

    Image maps

    Paul F. Johnson, Oct 21, 2003, in forum: HTML
    Replies:
    9
    Views:
    559
    Paul F. Johnson
    Oct 22, 2003
  4. Simon Elliott
    Replies:
    4
    Views:
    1,192
    Simon Elliott
    Mar 10, 2005
  5. Marcus
    Replies:
    2
    Views:
    622
    Marcus
    Dec 9, 2005
Loading...

Share This Page