Hello.
Sorry for a silly question, but I am not sure that I go into right direction.
I have a dozen of png files (some are with transparent background that I need to keep) and each of them contains several (well, form 2 to a few hundreds) square tiles. Tile size differs from file to file.
My task is to load them at runtime and then display on a form (like a tile map editor).
To simplify tiles loading I decided to use TImageList. It is easy to use visual component to load tiles from a file: just set tile size and click on "Add" button. But how can I do this from code:
Tiles1 := TImageList.Create(nil);
Tiles1.Width := 32;
Tiles1.Height := 32;
Tiles1. // <- I failed to find a method that will split a big image
Another thing is that sometimes I'd like to join images from several source files into single image list (tile size are identical).
Unfortunately I wasn't lucky googling the solution...
Also I am not sure if using TImageList is a correct way to go...
I am not asking for full implementation (however code snippet would be appreciated). I'd like to know the idea, correct way of solving of such task and a hint which methods I should use (full list of TImageList methods didn't give me a clue other than reading a big image and redrawing parts into separate slots - but I feel such approach is not optimal).
Thank you for the help.