temporarily saving the screen
BlitzMax Forums/BlitzMax Beginners Area/temporarily saving the screen
| ||
Hi again, could somebody show me how to save the current screen image into memory so I can use it as a backdrop for my highscore table? Thanks you in advance. |
| ||
'// Draw scene .... '// store backbuffer in Pixmap Local pm:TPixmap = GrabPixmap(0, 0, GraphicsWidth(), GraphicsHeight()); // or store in an Image' Local img:TImage = createImage( GraphicsWidth(), GraphicsHeight(), 1, FILTEREDIMAGE | MASKEDIMAGE | DYNAMICIMAGE ); GrabImage(img, x, y ); Note that drawing a full screen-sized Pixmap to the screen is pretty damn slow. You may be better off using the Image method. Problem here is that the PixelFormat for the Image may not match the PixelFormat of the BackBuffer. This will produce some very odd colouring errors. I only get this error when using the DirectX7 driver though. OpenGL seems to work fine. |
| ||
I'm using the CreateImage(), GrabImage() method for a function of mine and haven't run into any problems yet. Well, I did have a problem when I tried to use GrabImage in a loop. I wanted to grab the background and then zoom in on it...well, I first grabbed the image, then increased the scale and drew the image again, grabbed it again, increased the scale and drew it again, etc. It didn't work though, I got this weird green flare effect instead. So instead I just grabbed the image once and then kept increasing the scale and redrawing. Anyways, the method works and is plenty fast if you aren't going to be doing it often. |
| ||
Thanks guys I'll look into this. |
| ||
Thanks guys I'll look into this. |
| ||
Nice code. Is there a way to save a screenshot of the desktop itself not of the application? |
| ||
You will either have to some tricky Win32 API calls, or perhaps MaxGUI let's you access the Desktop directly. I wouldntknow, as I don't use MaxGUI. |
| ||
This might do it |
| ||
OK sorry for the lag in reply, I have sucessfully use the grabimage command. You are right the colors seem darket than the pixmap. Is there a way to remidy this like create an image from a pixmap? I take it that pixmaps take longer to be drawn? |