Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Memory full when loading multiple images
#5
(11-02-2024, 11:32 PM)Ikerkaz Wrote:
(11-02-2024, 11:25 PM)bplus Wrote: To reuse same imagehandle& number:

If imagehandle& < -1 then ' it contains an image
_freeimage imagehandle&
end if

imagehandle& = _LoadImage( ) ' load imagehandle& for reuse

Just do the first thing before each time you do the 2nd thing.

Thank you for your reply. But the wiki says in _FREEIMAGE " Note that calling _FREEIMAGE only frees the handle. It does NOT reset the variable used to store the handle back to 0."
I tried an example loading an image, its handle was -9 (for example), and after calling _FREEIMAGE its handle was -9... how can I know that I have freed the image? Maybe resetting manually the variable to 0?

If you need to reset that variable, you can do as bplus is suggesting and add this:

Code: (Select All)
If imagehandle& < -1 then _freeimage imagehandle&: imagehandle& = 0 'reset the handle to 0 after you free it
Reply


Messages In This Thread
RE: Memory full when loading multiple images - by SMcNeill - 11-03-2024, 02:39 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  about Hardware Images and _DisplayOrder,Help! qbfans 11 546 02-11-2026, 07:10 AM
Last Post: SMcNeill
  Nth problem with hardware images Ikerkaz 9 481 01-23-2026, 02:58 PM
Last Post: bplus
  Hardware images questions Dav 5 462 12-04-2025, 04:18 PM
Last Post: Pete
  Hardware images...Talk to me! Unseen Machine 5 728 09-22-2025, 11:12 PM
Last Post: TempodiBasic
  Loading from file into _MEM? and LEN a TYPE... Unseen Machine 9 958 08-03-2025, 02:55 AM
Last Post: SMcNeill

Forum Jump:


Users browsing this thread: 1 Guest(s)