Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hardware images...Talk to me!
#5
The basic breakdown over hardware images:

1) Hardware images are basically static images.  Once you make them, you can't change them.

2) The hardware screen is *always* a 32-bit screen of set pixel sizes.  You can't resize it.  If, as Pete mentioned, you're working in a SCREEN 0 text screen, the HARDWARE screen is going to be width * _fontwidth, height * _fontheight in size.  All other screens, it's simply going to match your width and height in pixels of the screen.

3) All you can basically do is put information to the hardware layer.  You don't read it back or alter it or interact with it.  You simply take your finished image (built it in software if you need to draw/write on the screen), copy it to hardware, and then _PUTIMAGE or _MAPTRIANLGE to place it on the screen.

4) Once all your images are in place on the hardware screen, you have to _DISPLAY to render them and draw them.

5) Don't forget to _FreeImage when done with them, like any other image to release that handle.



Code: (Select All)

SCREEN _NEWIMAGE(640,480,32)
fart = _NEWIMAGE(100,100,32) 'a second image
'draw crap on your fart. 
CLS, &HFFFF0000&&, fart 'I'm lazy.  I just made a big red fart

'now at this point, fart is a _SOFTWARE IMAGE.
stinky_fart = _COPYIMAGE(fart, 33) 'this gives us a handle to a hardware image copy of fart

DO
    _PUTIMAGE (x, y), stinky_fart 'this is all it takes.  You don't need to specify a destination as all hardware images go directly to the hardware layer
    _DISPLAY 'and this renders them on the screen.  
LOOP UNTIL done

'free the images once you're done
_FREEIMAGE fart 
_FREEIMAGE stinky_fart

Now there's a lot of stuff left out of that code above such as how x/y might change, or how the loop might become done, but what it focuses on is the steps to create your hardware image, place it on the hardware layer, and then display and free it.

It's the whole shebang of the process drawn out for you step-by-step.  If you have any more questions, feel free to ask, but it really is just that simple of a set-up for basic usage.  Everything else beyond is just adding bells and whistles and shortcuts or minor tweaks to the process.  Wink
Reply


Messages In This Thread
Hardware images...Talk to me! - by Unseen Machine - 09-14-2025, 04:48 AM
RE: Hardware images...Talk to me! - by bplus - 09-14-2025, 06:06 AM
RE: Hardware images...Talk to me! - by Pete - 09-15-2025, 08:05 AM
RE: Hardware images...Talk to me! - by SMcNeill - 09-15-2025, 10:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  about Hardware Images and _DisplayOrder,Help! qbfans 11 575 02-11-2026, 07:10 AM
Last Post: SMcNeill
  Nth problem with hardware images Ikerkaz 9 506 01-23-2026, 02:58 PM
Last Post: bplus
  Hardware images questions Dav 5 478 12-04-2025, 04:18 PM
Last Post: Pete
  Transparency with Hardware Images NakedApe 8 1,039 07-10-2025, 09:47 AM
Last Post: Pete
  How does QB64 support saving 8bit images? CMR 4 798 04-27-2025, 04:46 PM
Last Post: CMR

Forum Jump:


Users browsing this thread: 1 Guest(s)