View Single Post
  #4 (permalink)  
Old 01-14-2008, 03:56 PM
klaus's Avatar
klaus klaus is offline
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 675
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

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(Ma p_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(Ma p_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

Last edited by klaus : 01-18-2008 at 11:45 PM.
Reply With Quote