Results 1 to 9 of 9

Thread: "Monkey See, Monkey Doo.....Eww."

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    14
    Hey hey! Need help here. I'm trying to discover the way to select a specific section of a bitmap in my program to work as a button. What I really want is One large bitmap with different items on it, and have my program select the specific item off of the one bitmap for different buttons on the form. MyCaster does this, as well as NeoPlanet, and WinAmp too, I think.

    Any sujeschuns?
    "Curiosity killed the cat, but he still has eight lives left."
    - Xyanth

    "The only stupid question is the question never asked."
    - Xyanth

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    You could use GetCursorPos, and some other API stuff to do with this kinda thing like GetWindowRect (I think that's what it's called), GetPointInRect, etc.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Use GETCURSORPOS
    and use the hWnd of the bitmap
    and store data in a RECT of where you want it to be:

    Function MiR(Rcte as RECT, hWnd as Long) as Boolean
    Dim A as PointAPI
    A = GetCursorPos
    If A.X > rcte.left-1 and a.x < rcte.right+1 then
    If A.Y > rcte.top-1 and a.y < rcte.bottom+1 then
    MiR = True
    End If
    End If
    End Function
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    PowerPoster MidgetsBro's Avatar
    Join Date
    Oct 2000
    Location
    Apparently, Internet.com
    Posts
    3,125
    You can make the big picture in the background, then put smaller images around each of the items you want to be buttons. Then in the smaller image clicks, do your code.
    <removed by admin>

  5. #5
    Lively Member
    Join Date
    Jun 2000
    Posts
    124
    What about just putting empty labels over the areas that act as buttons and then putting something in their click events.
    On Error Resume Screaming...

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Harrys idea about having a bitmap with pixels indicating different click zones would apply here too, especially good for odd shaped areas.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    It's just a big look up table really.
    Harry.

    "From one thing, know ten thousand things."

  8. #8
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    What about mine? You guys (even the original poster) just completely overlooked my function. (BTW: you dont need the hWnd)
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  9. #9
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    probably the best for the simplest purposes

    MiR=A.X >= rcte.left and a.x <= rcte.right and A.Y >= rcte.top and a.y <= rcte.bottom

    would be simpler though
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width