PDA

Click to See Complete Forum and Search --> : "Monkey See, Monkey Doo.....Eww."


Xyanth
Feb 24th, 2001, 10:30 AM
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?

HarryW
Feb 24th, 2001, 07:17 PM
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.

Sastraxi
Feb 26th, 2001, 07:25 PM
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

MidgetsBro
Feb 26th, 2001, 10:52 PM
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.

DarkJedi9
Mar 3rd, 2001, 09:58 PM
What about just putting empty labels over the areas that act as buttons and then putting something in their click events.

kedaman
Mar 3rd, 2001, 10:34 PM
Harrys idea about having a bitmap with pixels indicating different click zones would apply here too, especially good for odd shaped areas.

HarryW
Mar 3rd, 2001, 10:59 PM
It's just a big look up table really.

Sastraxi
Mar 4th, 2001, 10:23 AM
What about mine? You guys (even the original poster) just completely overlooked my function. (BTW: you dont need the hWnd)

kedaman
Mar 4th, 2001, 04:20 PM
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