Re: The Common Black Box

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hello Thomas

>Well, I'm sure this has been asked a billion times but, how do I get rid of
>the black box around BMPs?
>    -- This is not good!
>How might I make the black transparent?
>Who programmed the idea that BMPs had to be boxes anyways? Doesn't seems
>like a very good idea,
>
>-Thomas

Well, since the computer screen is shaped like a box it kinda
makes since... :)

Well, I haven't seen my suggestion yet as to how to fix this
so I'll give it a shot.

My FIRST suggestion would be to use the Neil graphics library
by PETE EBERLEIN. With neil, you can do a clear_blit which only
puts the non-black pixels on the screen.

But if you prefer to use graphics.e becuase it is more familiar
...and I understand that... Here is my SECOND suggestion:

you have an image in a sequence variable in the format that
read_bitmap gives you (w/o the palette)

include graphics.e
include image.e

if graphics_mode (18) then end if

object pic,mask
pic = read_bitmap("c:\\windows\\bubbles.bmp")
all_palette (pic [1])
pic = pic [2]

constant line = repeat (BRIGHT_RED,640) -- make a background
for i = 1 to 480 do
  pixel (line-1,{0,i})
end for

sequence pos, size
pos = {10,10}
size = {length(pic[1]), length(pic)}

display_image (pos, pic) -- without mask

pos [1] += size [1] + 5
mask = (pic = 0) -- save all black pixels
mask = save_image (pos, pos+size-1) * mask
display_image (pos, mask + pic) -- with mask

hope this helps,
Lewis Townsend
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu