BMacZero, cheers for the assist.
Nomad, thanks for the code, that helped. By the way, this might help you workout the alpha part:
=================================
` GET IMAGE WITH TRANSPARENCY
` - Credit goes to Craig Chipperfield +(tiny edit from sasuke, bitmap bit)
`=================================
function GetImage( Image, Xstart, Ystart, Xend as dword, Yend as dword )
`Set up Local variables
Local Width as Dword
Local Height as Dword
Local Depth as Dword
Local Red as Byte
Local Green as Byte
Local Blue as Byte
Local Alpha as Byte
Local Memblock1 as integer
Local NewMemblock as integer
Local Bitmap as integer
`Find unused memblocks
Memblock1 = 1
repeat
inc Memblock1
until memblock exist( Memblock1 ) = 0
NewMemblock = 2
repeat
inc NewMemblock
until memblock exist( NewMemblock ) = 0
Bitmap = current bitmap()
`Do it!
make memblock from bitmap Memblock1, Bitmap
Width = memblock dword( Memblock1, 0 )
Height = memblock dword( Memblock1, 4 )
Depth = memblock dword( Memblock1, 8 )
make memblock NewMemblock, ( Width * Height ) + 12
Write memblock Dword NewMemblock, 0, Xend
Write memblock Dword NewMemblock, 4, Yend
Write memblock Dword NewMemblock, 8, Depth
`This is conufusing, in the demo by Craig theres plus 12 on this, but here it doesn't work
Position = ( Width * ( Ystart ) * 4 ) + ( Xstart * 4 ) + 12
NewPosition = 12
for y = 1 to Yend
for x = 1 to Xend
Blue = memblock byte( Memblock1, Position + 0 )
Green = memblock byte( Memblock1, Position + 1 )
Red = memblock byte( Memblock1, Position + 2 )
Alpha = memblock byte( Memblock1, Position + 3 )
write memblock byte NewMemblock, NewPosition + 0, Blue
write memblock byte NewMemblock, NewPosition + 1, Green
write memblock byte NewMemblock, NewPosition + 2, Red
write memblock byte NewMemblock, NewPosition + 3, Alpha
inc Position, 4
Inc NewPosition, 4
next x
inc Position , ( Width * 4 ) - ( Xend * 4 )
next y
`Make the image from the the memblock we have just manipulated
make image from memblock Image, NewMemblock
`Clean Up
delete memblock Memblock1
delete memblock NewMemblock
endfunction
I edited this get image function to work on the current bitmap (that has a bitmap format of 21 btw), still has a few issue with overlapping images that contain alpha, but it might help you to work out the alpha part, i'll take a look later also, cheers again
A dream is a fantasy, if you achieve that fantasy it was never a dream to begin with.