How to copy a TImage?
BlitzMax Forums/BlitzMax Beginners Area/How to copy a TImage?
| ||
Does anyone know of an efficient way to copy a TImage? Right now, i'm using: local imageCopy:TImage = loadimage(lockimage(originalImage)) ..which diesn't seem very efficient! thanks |
| ||
You could load the image file into a pixmap, and then loadimage twice from that pixmap. |
| ||
DrawImage GrabImage |
| ||
i ended up sticking with the method I posted above.. I got to testing it, and even though I'm doing it at full framerate, it hasn't slowed my application down at all, and I'm still maxed at my monitor refresh rate! |
| ||
if all of your images are of format rgba and of the same size it can be as simple as MemCopy(DestPixmap.pixels,sourcePixmap.pixels,sourcePixmap.width*sourcePixmap.height*4) edited corrected |
| ||
Local imageCopy:TImage = LoadImage(originalImage.pixmaps[frame])That's about as efficient as you can get. |
| ||
Are you modifying these copies? Why not just display the original? |