So frustrating! - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://staging.qb64phoenix.com/forumdisplay.php?fid=10) +---- Thread: So frustrating! (/showthread.php?tid=1537) Pages:
1
2
|
RE: So frustrating! - PhilOfPerth - 03-10-2023 Ahah, you done it again! Thanks bplus; I'll leave you in peace now (for a while anyway). RE: So frustrating! - mnrvovrfc - 03-10-2023 (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. RE: So frustrating! - PhilOfPerth - 03-10-2023 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. |