Placing image frames onto pixmaps

BlitzMax Forums/BlitzMax Programming/Placing image frames onto pixmaps

iprice(Posted 2007) [#1]
Is it possible to paste tiles/frames (from one image) onto a pixmap?

I'm able to place individual images onto a pixmap, using pixmap_image.paste(image,X,Y), but each image is loaded separately.

Have I missed a command to paste a certain frame from an anim_image (multiple frame image) onto the pixmap? eg. pixmap_image.paste(image,X,Y,FRAME)

If there's not a single command, has anyone created a function to do this?


Derron(Posted 2007) [#2]
See this function:

http://www.blitzmax.com/Community/posts.php?topic=72617#811598


bye
MB


iprice(Posted 2007) [#3]
That certainly looks like it will fit the bill :)

Cheers MichaelB


Arowx(Posted 2007) [#4]
You can use:

pixmap.window(x,y,w,h)

to extract a smaller frame from a pixmap into a larger pixmap, but the first image would need to be loaded as a pixmap first!

Not exactly what you asked for but I have found it useful!


Yan(Posted 2007) [#5]
destPixmap.Paste(sourceAnimImage.Lock(frame, 1, 0), destX, destY)



tonyg(Posted 2007) [#6]
This could be cleaned up



Derron(Posted 2007) [#7]
Am I right that none of your functions allows "drawing" the source on the destination?

I think of alpha-channels...

Yours seems (untested) like a "replacement" of a certain part of an image/pixmap.


bye
MB


tonyg(Posted 2007) [#8]
Yep, its pixmap.paste with a frame number as requested in the initial post.
<edit> this sorta works for Render-To-Texture.


iprice(Posted 2007) [#9]
Ooh! I've just noticed the extra replies.

I shall try these all out and use the easiest that gives the result I want.

Thanks to everyone. :D

Of course if anyone has further info, just post below. :)