Copying an image onto another
BlitzMax Forums/BlitzMax Beginners Area/Copying an image onto another
| ||
Simple question, with probably a complex answer, but... How can I copy a small image onto a larger one at a specific location in BlitzMax? In Blitz I could use [CODE] SetBuffer ImageBuffer(big_image) Drawimage small_image,x,y SetBuffer BackBuffer() [/CODE] Any help and/or code appreciated. :) |
| ||
By using pixmaps, not so complex after all ;) heheLocal buffer:TPixmap = LoadPixmap( "image1") Local pix:TPixmap = LoadPixmap( "image2") buffer.Paste( pix, x,y) Local image:TImage = LoadImage( buffer) |
| ||
Or with good ol' images...DrawImage big_image,0,0 DrawImage small_image,x,y GrabImage big_image,0,0Hope you're not in a rush, though. ;) |
| ||
yeah grabbing from video RAM is sloooow. |
| ||
Use grables idea but not with his approach. TImage save their pixmaps internally (needed for GL anyway). Use that pixmap and paste into those pixmaps as well. That way you can dynamically update your images. BM will automatically reload the image from pixmap the next time you draw it. that way you can even modify frames of animated images. |
| ||
Thanks for the replies - I'll have a play with those later :) |