Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can images be read from a file into an array?
#10
(02-17-2023, 02:10 AM)SMcNeill Wrote: I can fix this one!  SuperSteve to the Save!

Code: (Select All)
SCREEN _NEWIMAGE(800,600,32) 'dont forget me!
Dim Image(10) As Long
Image(0) = _LoadImage("RecPics/cat.jpg", 32)
Image(1) = _LoadImage("RecPics/cat.jpg", 32)
Image(2) = _LoadImage("RecPics/cat.jpg", 32)
Image(3) = _LoadImage("RecPics/cat.jpg", 32)
Image(4) = _LoadImage("RecPics/cat.jpg", 32)
_PutImage (0, 0), Image(2)
Sleep
_FreeImage (Image(2))

Bingo!
Steve wins the choccy frog! I was missing the _NewImage line. And there's my pussycat!
Now, I just have to select it (easy), size it (ok...), and position it (hmm...)
i think I'll be ok now. Thanks all for the help.  Big Grin  


You mention: "I get an "Illegal function call" error on line 7 (the _PutImage line)."

1 -- Dim Image(10) As Long
2 -- Image(0) = _LoadImage("RecPics/cat.jpg", 32)
3 -- Image(1) = _LoadImage("RecPics/cat.jpg", 32)
4 -- Image(2) = _LoadImage("RecPics/cat.jpg", 32)
5 -- Image(3) = _LoadImage("RecPics/cat.jpg", 32)
6 -- Image(4) = _LoadImage("RecPics/cat.jpg", 32)
7 -- _PutImage (0, 0), Image(2)

Only way that's line 7 is if that's the complete code, in which case, it's missing the call to work in a graphic screen.  Big Grin
 Yep, as Steve pointed out, I needed the _NewImage bit to make it work. That was the complete code for experimenting on. Thanks.
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, Western Australia.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply


Messages In This Thread
RE: Can images be read from a file into an array? - by PhilOfPerth - 02-17-2023, 02:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Has anybody experience with MODBUS to read temp sensors? Rudy M 28 1,673 02-27-2026, 04:21 PM
Last Post: Rudy M
  about Hardware Images and _DisplayOrder,Help! qbfans 11 574 02-11-2026, 07:10 AM
Last Post: SMcNeill
  Nth problem with hardware images Ikerkaz 9 503 01-23-2026, 02:58 PM
Last Post: bplus
  Hardware images questions Dav 5 477 12-04-2025, 04:18 PM
Last Post: Pete
  Hardware images...Talk to me! Unseen Machine 5 743 09-22-2025, 11:12 PM
Last Post: TempodiBasic

Forum Jump:


Users browsing this thread: 1 Guest(s)