How I split an image into 32*32 pieces? It's for a map editor for a game, and i have an image with 32*32 tiles in it, which i need seperated... I think it can be done using the BitBlt api, but i'm not sure how
Cheers!
Printable View
How I split an image into 32*32 pieces? It's for a map editor for a game, and i have an image with 32*32 tiles in it, which i need seperated... I think it can be done using the BitBlt api, but i'm not sure how
Cheers!
Depends on what you want done after the image is split. With BitBlt you could create a DC for the image, and Blit from a particular square to another part of the screen.
You can specify both source and destination rectangle co-ordinates when blitting.
What i want to do is put each tile in a picture/image box
Why did you move the thread ?! This is more of a VB Q than a game Q, so I want a quick answer, one which i'll get in the VB forum!
This is the Games and Graphics Programming forum...
Create a picture box at design time and set the index to 0. Then what you need to do is loop through the image pixels and with bitblt make the part of the pic in the small picbox. Then load the next item of the array, and so on...
try my map editor:
I'll just extract the splitting code from your map editor
Cheers!
no problem :)