1. Re: BMP

At 04:02 PM 3/25/98 -0600, you wrote:

>> Colin Taylor has a bitmap.e file and explains this in his text file:
>> "Windows bitmap (.bmp) files can be converted to Euphoria
>> bitmaps by the read_bmp() routine." I want to know how to convert .bmp to
>> (I assume) .bm files. An example is attached. Your help is appreciated!

This is misleading. The read_bmp() routine reads windows bmp
files directly. You then hand off the image portion -- s[2] -- to
Colin's routines (Which work nicely, by the way) to
massage the image.  He allows you to save an image
in his own proprietary .bm format, for specific reasons. (transparency and
masking)

A short test program:

include bitmap.e
include graphics.e
include image.e
include image.e
include get.e

sequence s
atom ok

use_vesa(1)
ok = graphics_mode(257)              -- set graphics mode
s = read_bitmap("CLAUDIA.BMP") -- read a small bitmap
s = s[2]                                          -- get rid of palette
display_image({10,10},s)               -- show at top left
s = bm_invert(s)                             -- filp it over
display_image({100,100},s)            -- show to right and lower

ok = bm_save(s,"CLAUDIA.BM")    -- write it in .BM format

s = wait_key()
ok = graphics_mode(-1)                  -- back to text mode

The .bm file may sometimes be slightly smaller than
the .bmp, but most I tried came out about twice as
large as the orig. And you can't use image editing
programs on a .bm
I think the only reason for saving in .bm format is when
you create a transparency or mask for another image.
I tried the compression routine, with no luck. Couldn't
expand them afterward.

Irv
----------------------------------------------------------
--Visit my Euphoria programming web site:--
--http://www.mindspring.com/~mountains   --
----------------------------------------------------------

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu