QB64 Phoenix Edition
Nth problem with hardware images - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10)
+---- Thread: Nth problem with hardware images (/showthread.php?tid=4397)



Nth problem with hardware images - Ikerkaz - 01-22-2026

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 Sad

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



RE: Nth problem with hardware images - SMcNeill - 01-22-2026

@Ikerkaz 

You're doing absolutely nothing wrong.  It works 100% as designed.   (Which unfortunately isn't how you intended. Tongue )

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.


RE: Nth problem with hardware images - Magdha - 01-22-2026

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?


RE: Nth problem with hardware images - SMcNeill - 01-22-2026

(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.


RE: Nth problem with hardware images - Kernelpanic - 01-22-2026

@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:

[Image: BMW-Einzylinder-1964.jpg]

[Image: Honda-c77-1967.jpg]


RE: Nth problem with hardware images - Ikerkaz - 01-22-2026

(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. Tongue )

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 Heart


RE: Nth problem with hardware images - SMcNeill - 01-22-2026

Awww heck.  That’s nothing unusual.  I LOVE ME, TOO!!  Big Grin


RE: Nth problem with hardware images - Pete - 01-23-2026

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.php?tid=4256&pid=39147#pid39147

Pete Big Grin


RE: Nth problem with hardware images - Ikerkaz - 01-23-2026

(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.php?tid=4256&pid=39147#pid39147

Pete Big Grin
I'll take a look Pete, thanks !!!  Tongue


RE: Nth problem with hardware images - bplus - 01-23-2026

On the job!