Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Bitmap Utility for locating Tiles within Bitmap

Author
Message
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 30th Jun 2007 17:01
I have alot of trouble extracting the right tile coordinates out of a bitmap file that has tiles of different images.

Can anyone point me in a direction of a utility that will help you identify the coordinates of different tiles within a bitmap file?

I'm thinking it should let you rubberband an area and tell you what it's coordinates are.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Jun 2007 18:55
Are you creating the bitmaps?

If so, you should be placing the individual sub-images in a grid where each cell is the same size. You can then simply use a nested For..Next loop to grab them.

TDK_Man

Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 30th Jun 2007 19:03 Edited at: 30th Jun 2007 19:04
I don't know if this will help, but I threw this together. Left click moves upper left corner, right click moves lower right corner.

Zergei
19
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 30th Jun 2007 19:35
I've got a programe that grabs varible tiled images from a specific made bitmap such as this one.

The prog would get all tiles and then allow you to set eachs offset value and save coordinates and offset values in 2 .dat files for use in another prog.

Only thing im still working out is how to maximize the use of the bitmap and not wasting lots of space. Of course the image i attached shows lots of unused sections, but thats because this was a test. It all comes to how you make the most out of it.

Further on my stuff at...

Attachments

Login to view attachments
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 1st Jul 2007 07:02
Crit I think that is exactly what I was talking about. I'm gonna try to add more functionality and I will post back. Thanks!

Zergei that sounds cool. I guess that would eliminate the need to do it manually which is sweet. Does that work based on the purple background? For example it checks an image over and down to the right until it encounters black again (in other words finds the edge of each purple background?) Sounds cool.

TDK, the tiles are different sizes. I suppose I could make them all based on the largest tile then they would be more predictable. Didn't think of that. Good point as well.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 1st Jul 2007 17:40
I have a question crit, the image jumps around a bit. I can't figure out why that is. At some moments its fine, other moments it seems to be cut off and zoomed in further than my selection box.

Any ideas?

I tried replacing the sprite command with just a paste image command and I'm getting the same thing.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
Zergei
19
Years of Service
User Offline
Joined: 9th Feb 2005
Location: Everywhere
Posted: 1st Jul 2007 18:31 Edited at: 1st Jul 2007 18:32
Quote: "Does that work based on the purple background? For example it checks an image over and down to the right until it encounters black again (in other words finds the edge of each purple background?)"


It works based on black(0,0,0) to check start and end of each tile. 2 consecutive black pixels found horizontally means end of tiles, and so continues on the following row, based on the max height from the tiles recently taken. Also, before going from one tile to another, it checks its height (the 2 consecutive black pixels vertically are not taken into account as "end" of anything).
When it finds green(0,255,0) means end of everything.
White(255,255,255) means nothing. Its just as reference for oneself when doing the allignment of the tiles and is not taken into account.

The only basic thing it lacks is a file selection, since i never did one, an didn't care to do so, one has to set the file path from code.

Further on my stuff at...
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 1st Jul 2007 23:31
MatriX, here is a slightly updated version. I added a little error checking and changed the box colors to remind you which button to use for the corners. I wasn't able to recreate the problem with the zoom. could you post a screen shot if it happens again?

MatriX
20
Years of Service
User Offline
Joined: 19th Oct 2003
Location: Deer Park, New York
Posted: 2nd Jul 2007 02:40
Yes, Crit thanks! That fixed the issue. I can post a screen shot if you still want to see it of the old version but its not necessary unless you want to see it. Nice, thanks again.

Thank you TGC for creating such amazing products!

Success does not come with meeting the minimum requirements.
Crit
18
Years of Service
User Offline
Joined: 24th May 2006
Location:
Posted: 2nd Jul 2007 05:28
Cool! I'm glad it worked for you.

Login to post a reply

Server time is: 2024-09-27 01:18:36
Your offset time is: 2024-09-27 01:18:36