This code snippet grabs the screen, converts it from a 1024,768,1 TImage to 1024,1,768 TImage result in t:TImage still not sure this is the best way to do it? Pixmaps would be good but cant see a way of making them flexible enough to create multi-framed images?
Local image:TImage = CreateImage( screenWidth, screenHeight, 1)', DYNAMICIMAGE )
GrabImage( image, 0, 0 )
Local pixmap:TPixmap=LockImage(image)
Local x_cells:Int=pixmap.width/screenWidth
Local y_cells:Int=pixmap.height/1
Local t:TImage = CreateImage( screenWidth, 1, screenHeight)', DYNAMICIMAGE )
For Local cell:Int=0 To screenHeight-1
Local x:Int=cell Mod x_cells * screenWidth
Local y:Int=cell / x_cells * 1
' selects a specific part of the image into a new pixmap
Local window:TPixmap=pixmap.Window( x,y,screenWidth,1 )
t.SetPixmap cell,window.Copy() 'copies the pixmap
Next
UnlockImage(image)
|