Image Processing?
BlitzMax Forums/BlitzMax Programming/Image Processing?
| ||
Hi I'd like to write a format for sprites that stores more informations about frames, blending, animations. For that I'd like to know more about how can I read the pixels from a image and how should I write pixels to a TImage for when I load it. My application is going pretty well but that info is vital EDIT: Also is it possible to have pixmaps of different sizes in a TImage? If not I guess you I can use multiple Images but I think that's a slowdown. |
| ||
how can I read the pixels from a image lockimage, readpixel, unlockimage how should I write pixels to a TImage lockimage,writepixel, unlockimage Also is it possible to have pixmaps of different sizes in a TImage? I've either misunderstood or you might need to check what a pixmap is again. |
| ||
It would be much more efficient for you to read and write pixmaps and then convert the pixmap into/from an image, rather than use pixel reading and writing. |
| ||
your best bet is to store your images all in one texture or maybe a couple. that way you can have different sizes and all kinds of other things packed in there. I was headed down that path myself until I got bored :( do a search in this forum on "single surface". |
| ||
how should I write pixels to a TImage lockimage,writepixel, unlockimage I thought that you could only write pixels to a pixmap. I tried writing pixels to an image without success. Do you have some code to show this in action? |
| ||
I thought that you could only write pixels to a pixmap. That is true and is why you need to lockimage to obtain access to the pixmap. This is then reflected the next time the image is drawn. |
| ||
OK. I know where I went wrong now. Cheers :) |