Board index » delphi » A _true_ BMP loader, please!

A _true_ BMP loader, please!

In the past few weeks I've been trying numerous BMP loaders, off SWAG (_and_
including Stefan Goehler's otherwise excellent graphics unit) to load a 256
colour 300*220 BMP file, which is of a newspaper (don't know if this is of any
consequence). In every single one of them, all the colours are completely
corrupted (purple, anyone?) and don't look anything like what they look in
Windows 95 Paintrbush (and yes, I've been taking pains to save them as 256
colour BMPs).
    Now, my question is: does anyone have a BMP loader that loads them _as they
appear_ in Windows 95? Or do you boffins out there suspect a inappropriate
palette, or video mode?
    I'm using mode 13. I think that means it's in 640*480 pixels.
    In any case, as I'm sure you can see, I'm confused by graphical modes. If
you require more information on my problem, please post. I can send you the
bitmap if needed.

Myles Fisher

 

Re:A _true_ BMP loader, please!


Quote
Myles Fisher wrote:

> In the past few weeks I've been trying numerous BMP loaders, off SWAG (_and_
> including Stefan Goehler's otherwise excellent graphics unit) to load a 256
> colour 300*220 BMP file, which is of a newspaper (don't know if this is of any
> consequence). In every single one of them, all the colours are completely
> corrupted (purple, anyone?) and don't look anything like what they look in
> Windows 95 Paintrbush (and yes, I've been taking pains to save them as 256
> colour BMPs).
>     Now, my question is: does anyone have a BMP loader that loads them _as they
> appear_ in Windows 95? Or do you boffins out there suspect a inappropriate
> palette, or video mode?
>     I'm using mode 13. I think that means it's in 640*480 pixels.
>     In any case, as I'm sure you can see, I'm confused by graphical modes. If
> you require more information on my problem, please post. I can send you the
> bitmap if needed.

> Myles Fisher

Besides your very annoying speech -

look for Bean's SHOWBMP in the graphics chapter of the 'TP-link'
URL for a very good explanation of "why" your palette makes
troubles:
http://www.geocities.com/SiliconValley/2926/tp.html

I just uploaded it one hour ago.

Franz Glaser

Re:A _true_ BMP loader, please!


Quote
> In the past few weeks I've been trying numerous BMP loaders, off SWAG (_and_
> including Stefan Goehler's otherwise excellent graphics unit) to load a 256
> colour 300*220 BMP file, which is of a newspaper (don't know if this is of any
> consequence). In every single one of them, all the colours are completely
> corrupted (purple, anyone?) and don't look anything like what they look in
> Windows 95 Paintrbush (and yes, I've been taking pains to save them as 256
> colour BMPs).
>     Now, my question is: does anyone have a BMP loader that loads them _as they
> appear_ in Windows 95? Or do you boffins out there suspect a inappropriate
> palette, or video mode?
>     I'm using mode 13. I think that means it's in 640*480 pixels.
>     In any case, as I'm sure you can see, I'm confused by graphical modes. If
> you require more information on my problem, please post. I can send you the
> bitmap if needed.

> Myles Fisher

you just have not just to load raw picture data, but a palette before it
--
      ..... ______________ ....  ...\\        :.............................
   ...: ____\__        __/___ :..:   :        :                            \\..
..//..: \\     \      /     / :   % metal defender/eugene e. pilyankevich %   :
:     :   |     \    /    :| .: % programmer with ansi/ascii drawing skills % :
:     :__/      :\  /     :|__  % unix security terrorist:) heavy metal fan % :
:     :\        :|\/_________/       :        :...............................:
:     : \________|      :   :.......//        :                   :
:....///(metal.defender):..// i'm a rocker... and noone can take it away \\----
                                     :......-Judas Priest         :............

Re:A _true_ BMP loader, please!


Quote
>    Now, my question is: does anyone have a BMP loader that loads them _as
they
>appear_ in Windows 95? Or do you boffins out there suspect a inappropriate
>palette, or video mode?
>    I'm using mode 13. I think that means it's in 640*480 pixels.
>    In any case, as I'm sure you can see, I'm confused by graphical modes.
If
>you require more information on my problem, please post. I can send you the
>bitmap if needed.

Combining these to comments, im thinking to possible errors.

Does the drawing routine know the size of the screen, if it doesnt i cant
draw
to other resolutions than it firstly where made if drawing uses offsets to
draw
to screen.

Another possible is that picture has too big palette.. When saving a bitmap
image check the how many bits image has? If i remember right, mode 13 has
only 16 colors and default saving format for bitmaps in Paint is 24bits wich
is
*quite* alot more than 16 colors ...

Re:A _true_ BMP loader, please!


Quote
Myles Fisher wrote in message <6mi5rp$5n...@perki.connect.com.au>...
>In the past few weeks I've been trying numerous BMP loaders, off SWAG
>including Stefan Goehler's otherwise excellent graphics unit) to load a 256
>colour 300*220 BMP file, which is of a newspaper (don't know if this is of
any
>consequence). In every single one of them, all the colours are completely
>corrupted (purple, anyone?) and don't look anything like what they look in
>Windows 95 Paintrbush (and yes, I've been taking pains to save them as 256
>colour BMPs).
>    Now, my question is: does anyone have a BMP loader that loads them _as
they
>appear_ in Windows 95? Or do you boffins out there suspect a inappropriate
>palette, or video mode?
>    I'm using mode 13. I think that means it's in 640*480 pixels.
>    In any case, as I'm sure you can see, I'm confused by graphical modes.

Mode 13? Maybe you mean mode 13h ? Mode 13h is 320x200 256 colours, and
trying to load a 320x220 bitmap may cause problems for your loader, so this
may be the problem. Is it just the palette that is incorrect? Or is the
image also corrupt? Maybe it loads correctly but the unit(s) you have been
using require another call to load / set the palette? Does it cause an
error, or does the program continue to run with the corrupt bitmap? If the
mode you are using is indeed 640x480, is it 256 colours? (I haven't used any
non-VESA 640x480 modes, but possibly the mode you are using is 16 colours,
or maybe it is "planar", or a couple of other things) Try a couple of the
suggestions posted in other replies, if you still can't get it working send
me the code & bitmap and I'll take a look.

--
Lors, Paradice Software
Christchurch, New Zealand
parad...@thevortex.com
http://surf.to/paradice
Creators of the cool new graphical RPG, Howl From Beyond.
Take the creature-creation competition!
--

Other Threads