Placing image frames onto pixmaps
BlitzMax Forums/BlitzMax Programming/Placing image frames onto pixmaps
| ||
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? |
| ||
See this function: http://www.blitzmax.com/Community/posts.php?topic=72617#811598 bye MB |
| ||
That certainly looks like it will fit the bill :) Cheers MichaelB |
| ||
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! |
| ||
destPixmap.Paste(sourceAnimImage.Lock(frame, 1, 0), destX, destY) |
| ||
This could be cleaned up |
| ||
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 |
| ||
Yep, its pixmap.paste with a frame number as requested in the initial post. <edit> this sorta works for Render-To-Texture. |
| ||
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. :) |