December 12, 200817 yr Is it possible to Divide an image into 5 or so different parts across 5 picture boxes without photoshoping the picture into 5 parts and then use 5 picboxes? I need to do this, so if a user clicks a certain part of the picture box I can program some event to go along with it. [software Engineer] - [Ability Bar Suggestion] - [Gaming Enthusiast]
December 14, 200817 yr Is it possible to Divide an image into 5 or so different parts across 5 picture boxes without photoshoping the picture into 5 parts and then use 5 picboxes? I need to do this, so if a user clicks a certain part of the picture box I can program some event to go along with it. Hmmm... day or 2 old topic but no responses... lets see if I have any kind of insight with this... I'm not familiar with VB08 so I can't be sure if anything I'm about to say works, but wouldn't it be possible to check where the click was on the picture (pixel x pixel)? If so, then simply create 1 single Subroutine for when they click on the picture and use that to establish where the click was. Then, depending on where the click falls in based on ranges you'll set up, have it execute 1 of X-many other Subroutines related to each individual area of the picture, but not actually attached to the picture directly in terms of how the program is executed. So as a general layout of the code, you could have something to the following. -On click of the picture- *code to find which pixel exactly was clicked* If (location) was between (X1,Y1) and (X2,Y2) Then Run (code 1) Elseif (location) was between (X3,Y3) and (X4,Y4) Then Run (code 2) etc etc So while you aren't actually "dividing" the image, you are creating a code that can determine which area, that you would have established before, was clicked in and execute the code appropriately. Sorry I can't be more help, but I left all of my reference books back on my campus (Christmas holiday atm) and those are all Visual Basic 6 books regardless, so I can't really give you exact code. don't worry, you are going to "hell" anyway. wanna race to see who gets there first?Officially reached 100 Combat at 1:33PM EST, June 14, 2007First Dragon Drop: Dragon Chain (Dust Devils) @ 10:48PM EST, July 14, 2008, lv113 combat
December 15, 200817 yr I would suggest using JS for this, it has some built in image mapping features. The GIMP even has a code generator for it. (Filters -> Web -> Image map)
December 15, 200817 yr I would suggest using JS for this, it has some built in image mapping features. The GIMP even has a code generator for it. (Filters -> Web -> Image map) Image maps are (x)html, visual basic is not a web thingy, I don't think? Last.fm Signature Overlays
December 15, 200817 yr ...There you see what happens when it's 6:40 am and you haven't had any coffee. :wall: Just thought of that on my way to school.
December 15, 200817 yr ...There you see what happens when it's 6:40 am and you haven't had any coffee. :wall: Just thought of that on my way to school. /me laughs at your screwed up timezone, I'm just about to go to sleep :P Last.fm Signature Overlays
December 15, 200817 yr This is pretty simple if you know where to look. Double click the picture box in question. Now your in the code view, there should be 2 drop down boxes just above the code. Click the one on the right and select on Mouse Click. Now add this to the sub Dim MouseX As Integer = e.X Dim MouseY As Integer = e.Y Now you can simply pick off the the x and y locations you wish to use. Remember 0,0 will be the top left. [hide=Drops]Dragon Axe x11Berserker Ring x9Warrior Ring x8SeercullDragon MedDragon Boots x4 - all less then 30 kcGodsword Shard (bandos)Granite Maul x 3Solo only - doesn't include barrows[/hide][hide=Stats][/hide]
Create an account or sign in to comment