So frustrating! - 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: So frustrating! (/showthread.php?tid=1537) Pages:
1
2
|
So frustrating! - PhilOfPerth - 03-09-2023 Ok, so this is probably quite simple, but it's frustrating the heck out of me! This is A.jpg (Please try to keep response simple). Code: (Select All) Screen _NewImage(1000, 800, 256) RE: So frustrating! - bplus - 03-09-2023 Try this: Screen _NewImage(1000, 800, 32) ' <<<< not 256 RE: So frustrating! - PhilOfPerth - 03-09-2023 (03-09-2023, 07:56 AM)bplus Wrote: Try this: Thanks bplus. I knew you'd come through! It works, of course. But I don't understand why 256 was not accepted. Nevamind, problem solvered, as they say. RE: So frustrating! - bplus - 03-09-2023 Hi Phil, I am looking at _LoadImage at Wiki now (to see if PDF, SVG, EPS, DXF images are accepted, doesn't look like it). It does appear 256 could work but I guess it depends of the image format the file was created under. I am no expert on this either. RE: So frustrating! - mnrvovrfc - 03-09-2023 (03-09-2023, 07:30 AM)PhilOfPerth Wrote: Ok, so this is probably quite simple, but it's frustrating the heck out of me! Do you really want to see that cute cat in 256 colors? Maybe in greyscale it could work... You got away with im(1) without dimensioning an array called "im". Try not to go over ten with the subscript. Otherwise you must do something like: Code: (Select All) DIm im(1 to 10) As Long near the top of your source code. Also remove the extra parenthesis from _FREEIMAGE call, they are not needed. It's not a function. RE: So frustrating! - a740g - 03-09-2023 Actually `Screen _NewImage(1000, 800, 256)` does work. The problem is with `im(1) = _LoadImage("RecPics/" + Chr$(65) + ".jpg")`. So, basically, we are trying to blit a 32bpp image to an 8bpp surface. This will not work. If we really want 256 color images, then we could change the _LoadImage line as: `im(1) = _LoadImage("RecPics/" + Chr$(65) + ".jpg", 256) ' this forces the image to be loaded as 8bpp` _LOADIMAGE - QB64 Phoenix Edition Wiki RE: So frustrating! - PhilOfPerth - 03-09-2023 Thanks all. I'm starting to get it. @mnrvovrfc: No I don't think I need 256 colours, the images are quite simple. They seem to be ok in 32 colours, so I'll stay with that. 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? RE: So frustrating! - bplus - 03-09-2023 For the record that 32 isn't 32 colors, I think it's 32 bits = 4 bytes, 1 byte = 2^8 = 256 each for Red, Green, Blue and Alpha. That's 256 * 256 * 256 * 256 color options. RE: So frustrating! - PhilOfPerth - 03-10-2023 Using 32bit mode, I'm not able to use any color options, although the pics are in ok colors. Is there a way to use my 32bit pics with color for text, frames etc. or do I need to use 256bit pics? Sorry to be so dense! RE: So frustrating! - bplus - 03-10-2023 Red~& = _RGB32(255, 0, 0) Green~& = _RGB32(0, 255, 0) ' very light green almost yellow Blue~& = _RGB32(0, 0, 255) Yellow~& = _RGB32(255, 255, 0) Purple~& = _RGB32(255, 0, 255) Cyan~& = _RGB32(0, 255, 255) Black~& = _RGB32(0, 0, 0) White~& = _RGB32(255, 255, 255) see _RGB32 in Wiki for complete description. So red print on blue paper: Color _RGB32(255, 0, 0), _RGB32(0, 0, 255) Where you see 255 you can replace with number 0 to 255 for different shades. |