Copying an image onto another

BlitzMax Forums/BlitzMax Beginners Area/Copying an image onto another

rockford(Posted 2007) [#1]
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. :)


grable(Posted 2007) [#2]
By using pixmaps, not so complex after all ;) hehe

Local buffer:TPixmap = LoadPixmap( "image1")
Local pix:TPixmap = LoadPixmap( "image2")
buffer.Paste( pix, x,y)
Local image:TImage = LoadImage( buffer)



Sledge(Posted 2007) [#3]
Or with good ol' images...
DrawImage big_image,0,0
DrawImage small_image,x,y
GrabImage big_image,0,0
Hope you're not in a rush, though. ;)


Grey Alien(Posted 2007) [#4]
yeah grabbing from video RAM is sloooow.


Dreamora(Posted 2007) [#5]
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.


rockford(Posted 2007) [#6]
Thanks for the replies - I'll have a play with those later :)