I had the same kind of trouble with bitmaps bigger than the screen which I scroll with a scroll bar.
Tried it like below, but still got the memory overload message but less often.
Sub HScroll_ValueChanged
If Done=1 Then Return
Done=1
MapX=HScroll.Value
bmpMap.Value=MapImage.CopyImage(ImageList1.Item(Map_I),MapX,MapY,GW,GH)
frmMain.DrawImage(bmpMap.Value,GX0,GY0)
Done=0
End sub
And after the first Out of memory message the variable Done remained at 1 and the bitmap did not move anymore.
Solved it like below:
Sub HScroll_ValueChanged
ErrorLabel(DoneH)
MapX=HScroll.Value
bmpMap.Value=MapImage.CopyImage(ImageList1.Item(Map_I),MapX,MapY,GW,GH)
frmMain.DrawImage(bmpMap.Value,GX0,GY0)
DoneH:
End Sub
Of course in scrolling I notice that some intermediate scroll values are not displayed, but this is less anoying than the error message.
Klaus
Switzerland