This is the second part. It writes images from the data labels.
;Read Data Write Image, on 21/9/06 Graphics3D 640,480,0,2 SetBuffer BackBuffer() Restore yourname_bmp ;image data label image=ReadDataWriteImage() ;image out ;Main loop While Not KeyHit(1) Cls DrawImage image,50,50 ;draw image out Text 0,0,"width="+ImageWidth(image)+" height="+ImageHeight(image) Flip Wend ;Includes Include "temp.bb" ;Functions Function ReadDataWriteImage() ;Read a data label, create image and write 24-bit color data Local imagesize,width,height,image,buffer,i,integer,count,rgb,x,y,ix ;create image Read imagesize ;first value is width/height width=imagesize And $0000FFFF height=(imagesize And $FFFF0000) Shr 16 image=CreateImage(width,height) buffer=ImageBuffer(image) ;write pixels from 8-bit run/24-bit color integer LockBuffer buffer While i<width*height Read integer count=integer And $000000FF rgb=(integer And $FFFFFF00) Shr 8 For x=ix To ix+count-1 WritePixelFast x,y,rgb,buffer Next ix=ix+count i=i+count If ix>=width Then y=y+1 : ix=0 Wend UnlockBuffer buffer Return image ;image handle End Function