1. Re: Newbie Alert!

The reason you can't use both palettes is because all_palette() replaces
all the colors in the palette from 0 to the length of the palette. Now,
if VP and RUN are 16-color bitmaps, you can show them individually with
their own palettes like so:

include image.e
include graphics.e
sequence allpal,vp
if graphics_mode(257) then -- 640x480, 8-bit
end if
vp=read_bitmap("vp.bmp")
allpal=vp[1]/4
display_image({0,0},vp[2])

vp=read_bitmap("run.bmp")
allpal &= vp[1]/4
all_palette(allpal)
display_image({0,0},vp[2]+16)

First, the program creates a sequence called allpal. When allpal is given
a value, it is the value of vp.bmp's palette. When run.bmp is read, its
palette is tacked onto the end of allpal. Then, the pixels in run.bmp have
16 added to it(because the first bitmap used 16 colors[you hope]). Then it
sets the palette to whats in allpal.
NOTE: Screen coordinates begin at 0,0, not 1,1

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu