External Graphics File Formats (page to fill in Programmer's Guide)

Forum for discussion about the documentation project.
fxm
Moderator
Posts: 10448
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

External Graphics File Formats (page to fill in Programmer's Guide)

Postby fxm » Jun 04, 2021 8:53

The external graphics file formats supported by rtlib through Bload and Bsave

In order to be able one day (I hope soon) to fill in this last page of the Programmer's Guide, I would like all users who have knowledge on this subject (and only these) to pass it to us via informal drafts posted here-below.

Thank you in advance.
paul doe
Moderator
Posts: 1441
Joined: Jul 25, 2017 17:22
Location: Argentina

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby paul doe » Jun 04, 2021 10:10

And what's this page supposed to contain? The bload documentation page says:

BLoad can load 3 different types of files:
  • Old QB-like data files, saved with BSAVE from QB code, containing "raw" data preceded by a 7-byte header, beginning with &HFD, up to 64 KiB in size
  • New FB-like data files, saved with BSave from FB code, containing "raw" data preceded by a 5-byte header, beginning with &HFE. There is no 64 KiB limit with this format
  • BMP image files, supports a subset of valid ("Windows") .BMP files, beginning with "BM", saved from FB code with BSave, or created / saved in a compatible format using a graphics editor / converter.

That's it. Those are the only 'external graphics file formats' supported by the rtlib. What more there is to say?
fxm
Moderator
Posts: 10448
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby fxm » Jun 04, 2021 11:05

When I asked @coderJeff the question, I only got this answer:
coderJeff wrote:For external graphics file formats topic: what is supported by BLOAD & BSAVE. To be cross platform, the QB/BMP formats that can be loaded/saved are hard coded in the rtlib. So, this is will be a description of what is specifically supported by the rtlib.
MrSwiss
Posts: 3845
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby MrSwiss » Jun 04, 2021 13:48

Well then, since both (coderJeff & paul doe) say essentially the "very same thing", there is "no more" to it, than that.
(everything else needs external libraries, dynamic or static like: e.g. FBImage or similar)
badidea
Posts: 2340
Joined: May 24, 2007 22:10
Location: The Netherlands

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby badidea » Jun 04, 2021 22:18

Complete documentation is off course best, but 99% of the questions here are like "how do I display JPG or BMP?"
So a programmers's Guide on external graphics should at least include an example to load and save a 32-bit bmp-file, I think.
And a mention that for other file types (JPG, PNG) external libraries or additional code is needed.
jj2007
Posts: 2168
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby jj2007 » Jun 05, 2021 8:21

badidea wrote:99% of the questions here are like "how do I display JPG?"
Nobody uses BMP. Under Windows, displaying a JPG with GdiPlus is relatively simple, but I can't speak for Linux, of course.
marcov
Posts: 3161
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby marcov » Jun 05, 2021 17:11

jj2007 wrote:
badidea wrote:99% of the questions here are like "how do I display JPG?"
Nobody uses BMP. Under Windows, displaying a JPG with GdiPlus is relatively simple, but I can't speak for Linux, of course.


BMP is used a lot in machine vision and as an intermediate format in general, as it is basically just a header + the pixels, and compression (usually to lossless PNG) is only done when storing to disc. JPG is worthless here, since most popular forms are inherently lossy.

That said, it might be worth specifying what exactly is the "BMP subset". (no RLE? Not all BPP?)
coderJeff
Site Admin
Posts: 3534
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Re: External Graphics File Formats (page to fill in Programmer's Guide)

Postby coderJeff » Jun 05, 2021 20:43

marcov wrote:That said, it might be worth specifying what exactly is the "BMP subset". (no RLE? Not all BPP?)

You nailed it there. Plus there is some support for reading in gfx files originally saved by QB's BSAVE itself.
Code is run time library implemented and doesn't use any win32 api calls so can be used on linux / dos, etc.

fxm, it's kind of been on my todo list to read the C code implementation and figure it out, but I also secretly hoped if asked enough times, there would be some nice community member that would want to help out too. :)

Return to “Documentation”

Who is online

Users browsing this forum: No registered users and 4 guests