• Print

Author Topic: QB64 GL doesn't load old bmp files correctly [not implemented yet]  (Read 106 times)

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
QB64 GL doesn't load old bmp files correctly [not implemented yet]
« on: May 01, 2013, 11:18:36 AM »
I've included the .bmp, the .bmp is made with a old paint which uses a different palette, it seems that this makes it incompatible with _PUTIMAGE, as it gives Illegal Function Call. The image itself loads fine, it is when I use it with _PUTIMAGE that it doesn't work.

You can try to comment the _LOADIMAGE line and uncomment the _NEWIMAGE to see that it works otherwise (with the same dimensions).

I tried changing the bpp argument to 256 to use a different 8-bit screenmode but that gives invalid handle error (-1) when I load the image so it doesn't load properly then.

Code: [Select]
SCREEN _NEWIMAGE(320, 200, 13)
'alba = _NEWIMAGE(12, 10, 13)
alba = _LOADIMAGE(".\80.bmp")

_PUTIMAGE (1, 1)-(10, 10), alba
CIRCLE (100, 100), 100
PRINT _WIDTH(alba), _HEIGHT(alba)
PRINT alba

I used the latest QB64 GL version (0.98).

I tried to use SCREEN alba directly after loading, it doesn't give any error but the image isn't displayed. EDIT: The image was printed over by the PRINT statement. Take that away and the image is displayed correctly using SCREEN alba. Still doesn't work with _PUTIMAGE though.
« Last Edit: May 01, 2013, 04:15:11 PM by Galleon »
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: QB64 GL doesn't load old bmp files correctly
« Reply #1 on: May 01, 2013, 12:27:25 PM »
Is it an RLE bitmap? Try saving it in Paint as a 16 or 256 color bitmap. No, that did not work either. WTF is the download for the updated GL with bitmaps? Is it the April 24th one?

I see that the error box does not go away either. How nice. Now it froze. It doesn't load any BMP files on XP.

It might help also if you did not print over it.  ;)

Doesn't _LOADIMAGE make LONG handles?

« Last Edit: May 01, 2013, 01:42:08 PM by Clippy »
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: QB64 GL doesn't load old bmp files correctly
« Reply #2 on: May 01, 2013, 01:51:55 PM »
If you load it in Paint and save it then it is saved with the old palette so that won't make any difference. I don't know if it is RLE, but it was created with the Paint that Windows 98 had. I could cut and paste it into a new image and save it, but I wouldn't do so for all the images just so that it can be used in QB64 GL, then I'd rather use the SDL version until the problem is sorted out.

Yes it is the April 24th one.


It did help that I didn't print over it :) If you load it then use SCREEN alba then it is displayed. It still doesn't work with _PUTIMAGE though.


I don't know if _LOADIMAGE makes LONG handles, but it creates the same type of handle for any surface as it's simply a reference to the surface. Either way when loading it the handle is -2, the same as if you created a _NEWIMAGE. So it appears as a valid handle, and it is if you use SCREEN but _PUTIMAGE appearently can't handle it.
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Clippy

  • Hero Member
  • *****
  • Posts: 16446
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
    • Email
Re: QB64 GL doesn't load old bmp files correctly
« Reply #3 on: May 01, 2013, 03:12:53 PM »
I tried saving it as a GIF and it did not load either. SDL runs it fine!

I could not get QB64icon.bmp to run either so I don't know what to say.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

Cyperium

  • Hero Member
  • *****
  • Posts: 3336
  • Knowledge is good, but understanding is better
    • Cyperium
    • Email
Re: QB64 GL doesn't load old bmp files correctly
« Reply #4 on: May 01, 2013, 04:06:37 PM »
It works for me in Win 7. I don't know what he used to get the functionality, but it's clear that it's not the optimal way.

Code: [Select]
SCREEN _NEWIMAGE(640, 480, 32)
hand = _LOADIMAGE(".\qb64icon.bmp")
_PUTIMAGE (0, 0), hand, 0
Venture - New Prototype, QB64 Editor v1.95b (linux compatible, if you compile the source).

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 4711
  • QB Forever
    • Email
Re: QB64 GL doesn't load old bmp files correctly
« Reply #5 on: May 01, 2013, 04:14:35 PM »
Interpreting 256-color/palette images for use in non-rgba surfaces has not been reimplemented yet. It's on the todo list (somewhere). Doesn't matter if it is png, jpg or bmp.
Something old... Something new... Something borrowed... Something blue...

  • Print