SetViewPort Clipping
BlitzMax Forums/BlitzMax Programming/SetViewPort Clipping
| ||
I am loading a large .png and then using GrabPixmap() to cut the image up into smaller sprites. The png file is larger than my visible screen area, and GrabPixMap() returns a block of corrupt data from the areas that are not visible. I am guessing that the .png is not being plotted to the graphics buffer beyond the visible screen area? I though that extending the Viewport to the .png width and height before plotting would fix this but it does not. Has anyone else come across this problem before, I have spent a few hours looking for a solution and have found nothing so far. |
| ||
Instead of drawing and grabbing, would PixmapWindow() be more useful? |
| ||
how about pixmapwindow() |
| ||
Thanks I will give it a go, hope it deals with transparency as I am using .png format with Alpha. (edit) Works like a dream, does exactly what it says on the packet including transparency. Thanks again. Global screen:TImage = LoadImage( screen.png" ) Local pixmap:TPixmap = PixmapWindow( LockImage:TPixmap( screen, 0 ), x, y, w, h ) SavePixmapPNG( pixmap, "cutout.png", 0 ) Last edited 2011 |
| ||
The backbuffer is only the size of the screen resolution, you can't draw outside of it. |
| ||
But you could render-to-texture to a larger texture. |