Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to create a simple tilemap of Picture boxes and tried to use this code on stackoverflow to do so:

http://stackoverflow.com/questions/23786295/[^]


New winform Project and the only thing that differs is that I load my images from included Resources but only one single picturebox is shown at location 0,0.

Debugging shows that the Picture boxes are created and at different locations so it's not that.

printing this.controls.count shows that the new picture boxes are added.

Not sure what I'm going to use it for, just that I wanted to try it and wants to figure out what went wrong. XD
Posted
Comments
johannesnestler 26-May-15 8:40am    
so how big is your test Image, is it to small?
Member 11683251 26-May-15 8:44am    
50x50, as I said one of them shows up (the first) but not the rest. Manually creating picture boxes also shows up fine using the same image.
johannesnestler 26-May-15 8:50am    
the code you linked to splits a large Image into many small ones, each containing one part of the Image, so I thought maybe you are just using an Image too small. and all the other pictureboxes are painted with nothing... was just my first thought, sorry for not beeing helpful
Member 11683251 26-May-15 8:55am    
Actually you seem to be spot on. Tried using a bigger picture and now it worked. Seems that I misunderstood what the code did. I assumed that it would just take a source image and then use that as a basic tile and fill out an area depending on how many times you looped.

Thanks! If you post it as a solution I'd gladly accept your answer.
johannesnestler 26-May-15 9:37am    
I'm glad you solved it, sometimes another pair of eyes helps ;-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900