[futurebasic] Bitmapness

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 2002 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Mon, 9 Dec 2002 01:05:56 -0400

Anybody who knows how to get at the pixel data for a 1 bit depth GWorld (as
opposed to a bitmap), please e-me before I go bonkers.

I am blockmoving by row, peeking poking, and while the image is obviously
there (as seen by a copybits copy) getting it into a handle that converts
to an ICN# is driving me crazy. Works with a bitmap, not with a 1 depth
GWorld.

ArAArGH.

Pseudocode like:

DIM @rowbytes as long
DIM @rowAddr as ptr
Dim @tempGW as ptr
DIM iRect as Rect

setRect(iRect,0,0,32,32)

long if ( fn NewGWorld( tempGW, 1, iRect, 0, 0, 0 ) == _noErr )

locked = FN LockPixels(fn GetGWorldPixMap( tempGW ))
long if locked

//Get Pixels into the 256byte handle (first half of 128 bytes is the GWorld
data, second 128 bytes is the mask)

pmHandle = fn GetGWorldPixMap( tempGW )
rowAddr  = fn GetPixBaseAddr( pmHandle )
rowBytes = pmHandle..RowBytes AND 0x3FFF // is 16 with 1 depth GWorld, 4 in
a bitmap

peek poke into dataH....argggh.

end if

end if


Works with a  bitmap:

offX = 0
dummy    = maskGW.baseAddr
rowBytes = maskGW.rowbytes
for y = 0 to 31
BLOCKMOVE dummy,[dataHnd]+offX,rowBytes
offX  += rowBytes
dummy += rowBytes
next y

No workee in any fashion with GWorld.

rc