TBankStream to TImage

BlitzMax Forums/BlitzMax Beginners Area/TBankStream to TImage

Bertrand(Posted 2007) [#1]
I'm creating a BMP file inside a TBankStream object and i'm looking for convert it in TImage or TPixmap object without wrighting my bank on the HD.
Any ideas?
thx


FlameDuck(Posted 2007) [#2]
LoadImage(myTBankStream)


Bertrand(Posted 2007) [#3]
Well, it's really don't work. Could u just check this and tell me were i'm wrong!

Strict

'720*576 picture
Global in:String = "F:\Projects\dev\images\SeqBMP\Cauet01.1.bmp"
Global out:String = "F:\Projects\dev\images\Framestore\filestore.fs"

Global load:TStream = ReadStream(in)
Global save:TStream = WriteStream(out)

CopyStream(load, save)
SeekStream(load, 0)
CopyStream(load, save)

CloseStream(load)
CloseStream(save)

Global bnk:TBank = CreateBank(1244214)
Global pic:TImage
Global ramPic:TBankStream = CreateBankStream(bnk)

save = ReadStream(out)
SeekStream(save, 1244214)

CopyBytes(save, ramPic, 1244214)
pic = LoadImage(rampic)

Global win:TGadget = CreateWindow("test",20,20,800,700, Desktop(), 15)
Global can:TGadget = CreateCanvas(0,0,720,576,win)
SetGraphics CanvasGraphics(can)
DrawImage(pic,0,0)
Flip


While WaitEvent()
Select EventID()
Case EVENT_WINDOWCLOSE
End
End Select
Wend