QBJS Image Question - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: QBJS, BAM, and Other BASICs (https://qb64phoenix.com/forum/forumdisplay.php?fid=50) +--- Thread: QBJS Image Question (/showthread.php?tid=1951) |
QBJS Image Question - bplus - 08-31-2023 @dbox Does the image have to be accessible from Internet? I found one example with that, the Chuck Norris demo. I am trying to figure out how to get QB64 logo image into banner. How do we get images loaded from our computer drive? RE: QBJS Image Question - bplus - 08-31-2023 Testing loading an image from here: RE: QBJS Image Question - dbox - 08-31-2023 You can either use an image that is accessible on the internet or can use image assets that are saved as part of your QBJS project. I just actually just did a write up that explains how to do this yesterday over here: https://qb64phoenix.com/forum/showthread.php?tid=1947&pid=19150#pid19150 RE: QBJS Image Question - dbox - 08-31-2023 (08-31-2023, 05:41 PM)bplus Wrote: Testing loading an image from here: You could certainly use that image: RE: QBJS Image Question - CharlieJV - 08-31-2023 (08-31-2023, 05:20 PM)bplus Wrote: @dbox Same-origin policy Not that I'm any expert in the subject, but with my amateur hat on: cross-site resource sharing can be a tricky business. If you want a QBJS instance out there on the web to have access to images, those images need to be hosted somewhere out there on the web with some kind of HTML header that allows cross-origin resource sharing. And regarding local images/resources: nothing on the web will ever ever ever have access to local images/resources. That should never be allowed. A local QBJS instance should be able to access local resources, and I'm pretty sure a local QBJS instance cannot access resources on the web. The behaviour of local QBJS might depend on device, operating system, browser. RE: QBJS Image Question - bplus - 08-31-2023 Thanks I missed it the first time for Terry, good! looks easy enough. Update: finally got it working with the old $IF WEB trick using the above link for QBJS and a private disk file for QB64. But I ran into a number of problems using _PutImage with grymmjack's thing for shrinking the image in QBJS, ie hard numbers won't line up with xmx and ymx constants for screen width and height. I was getting double printing of heading! So I am sticking to required 1400 x 256 and just moving screens to check drawing alignments. |