Posts: 54
Threads: 12
Joined: Apr 2022
Reputation:
2
I know, I know. The problem is ME; I'm a complete idiot trying to understand hardware images...
Why isn't something as simple as this working? What on earth am I doing wrong? My apologies to everyone, and thank you for your patience
Code: (Select All)
Option _Explicit
Randomize Timer
Dim As Long hardwareScreen, workScreen, Nave, Fondo, i
Screen _NewImage(1920, 1080, 32)
_FullScreen , _Smooth
workScreen = _NewImage(1920, 1080, 32)
Fondo = _LoadImage("C:\STRC\Espacio\3.jpg")
Nave = _LoadImage("C:\STRC\Naves\Constitution2\nave.png")
_PutImage (0, 0)-Step(1920, 1080), Fondo, workScreen
For i = 1 To 100
_PutImage (Rnd * 1920, Rnd * 1080), Nave, workScreen
Next
hardwareScreen = _CopyImage(workScreen, 33)
_Dest 0
_DisplayOrder _Hardware
_PutImage (0, 0), hardwareScreen
_Display
End
10 PRINT "Hola!  "
20 GOTO 10
Posts: 3,447
Threads: 376
Joined: Apr 2022
Reputation:
345
@Ikerkaz
You're doing absolutely nothing wrong. It works 100% as designed. (Which unfortunately isn't how you intended.  )
Code: (Select All)
Option _Explicit
Randomize Timer
Dim As Long hardwareScreen, workScreen, Nave, Fondo, i
Screen _NewImage(1920, 1080, 32)
_FullScreen , _Smooth
workScreen = _NewImage(1920, 1080, 32)
Fondo = _LoadImage("Z:\Jan 2026.png")
Nave = _LoadImage("Z:\steve1973.gif")
_PutImage (0, 0)-Step(1920, 1080), Fondo, workScreen
For i = 1 To 100
_PutImage (Rnd * 1920, Rnd * 1080), Nave, workScreen
Next
hardwareScreen = _CopyImage(workScreen, 33)
_Dest 0
_DisplayOrder _Hardware
Do
_PutImage (0, 0), hardwareScreen
_Display
_Limit 30
Loop Until _KeyHit
End
The issue? You're putting it on a hardware screen, which *WORKS*. It's displaying properly without any issues whatsoever.
So why are you seeing nothing?
Because the program then ENDs and swaps to a software screen to say "Press Any Key to Continue." <-- This erases that hardware screen.
See the only change made above to make it work? (Not counting file names so it would find test images to run on my machine?)
I just made it look for a keypress before ending, so you could see the display. Press a key and then you can see that END screen and where it's erasing your image from displaying.
Put it in a DO...LOOP like I have, with a nice limit, and then drop to SYSTEM when done and you won't have this type display error making it seem like you messed up when you didn't.
Posts: 164
Threads: 54
Joined: Sep 2025
Reputation:
18
Steve The Amazing is always correct, of course.
Fondo = _LoadImage("Z:\Jan 2026.png")
Nave = _LoadImage("Z:\steve1973.gif")
But I thought that loading from a harddisk image file, you had to state the type of image as:
Fondo = _LoadImage("Z:\Jan 2026.png",32)
Nave = _LoadImage("Z:\steve1973.gif",32)
or ,33 or ,256 or some such.
Is that not necessary?
Posts: 3,447
Threads: 376
Joined: Apr 2022
Reputation:
345
(01-22-2026, 05:52 PM)Magdha Wrote: Steve The Amazing is always correct, of course.
Fondo = _LoadImage("Z:\Jan 2026.png")
Nave = _LoadImage("Z:\steve1973.gif")
But I thought that loading from a harddisk image file, you had to state the type of image as:
Fondo = _LoadImage("Z:\Jan 2026.png",32)
Nave = _LoadImage("Z:\steve1973.gif",32)
or ,33 or ,256 or some such.
Is that not necessary?
Adding that makes it convert to that format for you automagically. Without it, it loads based on the current screen.
As per the wiki: The mode& parameter can be 32, 33, 256, or 257. Omit to use the current graphic screen settings.
Posts: 956
Threads: 52
Joined: May 2022
Reputation:
38
@Steve, it's not working for me. The first time I tried, the screen was chaotic, but the images were briefly displayed for half a second. From the second attempt onward, it was just a black screen. I had to abort always with Ctrl+C.
The two images:
Posts: 54
Threads: 12
Joined: Apr 2022
Reputation:
2
01-22-2026, 08:57 PM
(This post was last modified: 01-22-2026, 08:57 PM by Ikerkaz.)
(01-22-2026, 05:40 PM)SMcNeill Wrote: @Ikerkaz
You're doing absolutely nothing wrong. It works 100% as designed. (Which unfortunately isn't how you intended. )
The issue? You're putting it on a hardware screen, which *WORKS*. It's displaying properly without any issues whatsoever.
So why are you seeing nothing?
Because the program then ENDs and swaps to a software screen to say "Press Any Key to Continue." <-- This erases that hardware screen.
See the only change made above to make it work? (Not counting file names so it would find test images to run on my machine?)
I just made it look for a keypress before ending, so you could see the display. Press a key and then you can see that END screen and where it's erasing your image from displaying.
Put it in a DO...LOOP like I have, with a nice limit, and then drop to SYSTEM when done and you won't have this type display error making it seem like you messed up when you didn't.
Now I have a VERY BIG FACEPALM in my head... THANK YOU THANK YOU THANK YOU I LOVE YOU @SMcNeill
10 PRINT "Hola!  "
20 GOTO 10
Posts: 3,447
Threads: 376
Joined: Apr 2022
Reputation:
345
Awww heck. That’s nothing unusual. I LOVE ME, TOO!!
Posts: 2,910
Threads: 305
Joined: Apr 2022
Reputation:
167
01-23-2026, 02:08 AM
(This post was last modified: 01-23-2026, 02:09 AM by Pete.)
Does the board come with included janitorial service?... Because I just totally threw up on isle #7.
@Ikerkaz Have a look at some of the fun stuff you can do with hardware acceleration in screen 0. Eventually I'll merge my buttons routine into it, but for now, 5 kinds of nice drop down or popup menus.
https://qb64phoenix.com/forum/showthread...7#pid39147
Pete
Posts: 54
Threads: 12
Joined: Apr 2022
Reputation:
2
(01-23-2026, 02:08 AM)Pete Wrote: Does the board come with included janitorial service?... Because I just totally threw up on isle #7.
@Ikerkaz Have a look at some of the fun stuff you can do with hardware acceleration in screen 0. Eventually I'll merge my buttons routine into it, but for now, 5 kinds of nice drop down or popup menus.
https://qb64phoenix.com/forum/showthread...7#pid39147
Pete  I'll take a look Pete, thanks !!!
10 PRINT "Hola!  "
20 GOTO 10
Posts: 4,698
Threads: 222
Joined: Apr 2022
Reputation:
322
On the job!
724 855 599 923 575 468 400 206 147 564 878 823 652 556 bxor cross forever
|