Blitz (17/64)

From:David McMinn
Date:7 Apr 2001 at 14:06:44
Subject:Re: Screenshots

On 7 Apr 2001, at 11:25, Deftone wrote:

> I mean to code a small simple workbench grabber :)
> But i do not know how to get the screen and then save it :)

; Obviously if you want to grab other screens you would use
; something else than WBToScreen. I have some code for going
; through the list of public screens, which might be able to
; adapt for all screens.
WBToScreen 0

; Oh, this will only work for bitmaps with up to 8 planes
; deep, since AFAIK that is all that the Blitz commands
; support. You'd probably have to write your own functions
; for saving >8 bits.
*scr.Screen = Peek.l(Addr Screen(0))

; This is a REALLY BAD way of finding the dimensions of the screen
; bitmap. You should really use GetBitMapAttr_ (or similar)
; from graphics.library.
BitMap 0,*scr\Width, *scr\Height, *scr\RastPort\BitMap\Depth

BltBitMap_ *scr\RastPort\BitMap,0,0,Addr BitMap(0),0,0,*scr\Width,
*scr\Height,$C0

; I think that is the correct call for BltBitMap_ but I'm not
; sure as I do not have my autodocs here.

SaveBitMap 0,"ram:grab.iff"

Hope that helps. I'm not sure how to grab the palette from the screen,
but I can send you that code for getting a list of screens if you want.
|) /\ \/ ][ |) |\/| c |\/| ][ |\| |\| | dave@blitz-2000.co.uk
http://members.nbci.com/david_mcminn | ICQ=16827694

---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list/-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list/-help@netsoc.ucd.ie