Author Topic: Problem with image in upcoming v1.5 (dev build)  (Read 3818 times)

0 Members and 1 Guest are viewing this topic.

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Problem with image in upcoming v1.5 (dev build)
« on: December 18, 2020, 02:03:59 pm »
It looks like version 1.5 has a problem with images. The picture will probably not be found. There are no problems with version 1.4.

  [ You are not allowed to view this attachment ]  
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

FellippeHeitor

  • Guest
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #1 on: December 18, 2020, 02:08:38 pm »
Please provide the image file you're attempting to use and also paste the code here so we can check it.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #2 on: December 18, 2020, 02:51:50 pm »
Quick question:  Did you copy the image in the 1.5 Folder?

V1.4 would be in one path, v1.5 would be in a different path, so it makes sense that code just copy/pasted from one to the other wouldn't find resource files in the other's folder.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #3 on: December 18, 2020, 03:02:00 pm »
Quick question:  Did you copy the image in the 1.5 Folder?

Makes sense, seeing as how he's only using the filename rather than the absolute path.
Shuwatch!

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #4 on: December 18, 2020, 04:54:22 pm »
File and picture are in the same folder.

Code: QB64: [Select]
  1. 'Uebungen Bild laden
  2.  
  3.  
  4. DIM NeuesFenster AS LONG, Bild AS LONG
  5.  
  6. NeuesFenster = _NEWIMAGE(1024, 768, 32)
  7. SCREEN NeuesFenster
  8.  
  9. 'Vordergrund- und Hintergrundfarbe
  10. 'COLOR _RGB32(255, 0, 0), _RGB32(255)
  11. 'LOCATE (CSRLIN + 2), POS(0)
  12. 'PRINT "Hallo, QuickBasic 64!"
  13. 'SLEEP
  14.  
  15. 'Bild laden
  16. Bild = _LOADIMAGE("Marilyn.jpg", 32)
  17. _DEST NeuesFenster
  18. '_PUTIMAGE (0, 0)-(320, 200), NeuesFenster, 0, (0, 0)-(320, 200)
  19. _PUTIMAGE (0, 0), Bild
  20.  
  21.  

  [ You are not allowed to view this attachment ]  

  [ You are not allowed to view this attachment ]  
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #5 on: December 18, 2020, 05:01:37 pm »
The same problem. The picture ist in the folder "Bilder". In Version 1.4 no problems.

Code: QB64: [Select]
  1. 'Uebungen Bild laden
  2.  
  3.  
  4. DIM NeuesFenster AS LONG, Bild AS LONG
  5.  
  6. NeuesFenster = _NEWIMAGE(1024, 768, 32)
  7. SCREEN NeuesFenster
  8.  
  9. 'Vordergrund- und Hintergrundfarbe
  10. 'COLOR _RGB32(255, 0, 0), _RGB32(255)
  11. 'LOCATE (CSRLIN + 2), POS(0)
  12. 'PRINT "Hallo, QuickBasic 64!"
  13. 'SLEEP
  14.  
  15. 'Bild laden
  16. Bild = _LOADIMAGE("Bilder\Marilyn-1956.jpg", 32)
  17. _DEST NeuesFenster
  18. '_PUTIMAGE (0, 0)-(320, 200), NeuesFenster, 0, (0, 0)-(320, 200)
  19. _PUTIMAGE (0, 0), Bild
  20.  
  21.  
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #6 on: December 18, 2020, 05:07:12 pm »
Second Question: In 1.5 (where the glitch appears), have you checked the "export EXE  to source folder" option?
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #7 on: December 18, 2020, 05:08:18 pm »
Works as expected under 1.5 and also under 1.4

  [ You are not allowed to view this attachment ]  

try add coma to path (".\bilders\.....")

 
« Last Edit: December 18, 2020, 05:12:19 pm by Petr »

Offline Kernelpanic

  • Newbie
  • Posts: 94
    • View Profile
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #8 on: December 18, 2020, 05:30:16 pm »
Second Question: In 1.5 (where the glitch appears), have you checked the "export EXE  to source folder" option?

That was it! Now it is ok.

It would be good to make that the default.

Addendum: I only know of this that the executable file is by default in the same directory as the source file. QB64 behaves here in a really unusual way.
« Last Edit: December 18, 2020, 06:51:32 pm by Kernelpanic »
Mark Twain
"Als wir das Ziel endgültig aus den Augen verloren hatten, verdoppelten wir unsere Anstrengungen."
„Having lost sight of our goals, we redoubled our efforts.“

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Problem with image in upcoming v1.5 (dev build)
« Reply #9 on: December 18, 2020, 09:07:04 pm »
When you compile, the source file, by default, goes in the QB64 folder with QB64.EXE.

What you've done is compiled one EXE in the data folder with the picture with v1.4, and then compiled a separate EXE in the QB64 V1.5 folder.  You're still seeing the EXE in your data folder from a previous build, but the one in the 1,5 folder is what is executing and tossing an error for invalid handles from files not pathing properly.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!