Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
So frustrating!
#11
Ahah, you done it again!
Thanks bplus; I'll leave you in peace now (for a while anyway).  Big Grin
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply
#12
(03-09-2023, 10:36 PM)PhilOfPerth Wrote: Is it ok to have a file with maybe 20 images in it, but only have one image-handle, and attach a different pic  each time? and if so, when do I need to use _FreeImage?

You can have one file with 20 images or any number of images, but for sanity's sake one "picture within a picture" inside the image should be the same size as the others. You load it with _LOADIMAGE like you just did in your program, then to select the picture you want to show you use _PUTIMAGE. You have to figure out the coordinates for the (top, left) and (bottom, right) of the "big" picture to get the "little" picture, then use _PUTIMAGE to display it on the screen to show the user.

The little pictures could be of various sizes but it could be confusing if you don't know where one picture begins and ends. Windows Paint could be used to help figure out the coordinates but it could be tedious panning around in the picture and having to write row and column integers somewhere else.

If you load one picture you only need to call _FREEIMAGE to affect that picture. If you create an array of 20 LONG variables and each one sets its value with a call to _LOADIMAGE or _NEWIMAGE (except if it fails by returning -1), you have to call _FREEIMAGE for each array element. However you have to make sure the handle is not the active display, it's not set by _DEST or QB64(PE) would give you an error saying it cannot get rid of the active screen.

The "256" as the last parameter to _LOADIMAGE or _NEWIMAGE is called "8-bit color", it's just a term, it only offers 256 colors. It's "SCREEN 13" in your earlier programming days with QuickBASIC or QBasic, but you could change the dimensions from 320x200 now considered too small for the really large screens that are the rage these days, at least in the U.S.A. LOL. The "32" is for at least 16MB colors, which requires using _RGB() like bplus just said. The "33", well, erm, ah... you could search for it for the dozens of times Steve got up to explain it. Smile
Reply
#13
Thanks for that info, mnrvovrfc (I must find out how to pronounce that!) Lots of good info, and very clearly explained, which is essential for me. 
I'll go and adjust my listing accordingly.  Smile
Of all the places on Earth, and all the planets in the Universe, I'd rather live here (Perth, W.A.) Big Grin
Please visit my Website at: http://oldendayskids.blogspot.com/
Reply




Users browsing this thread: 6 Guest(s)