1. display_image()

This is a multi-part message in MIME format.

------=_NextPart_000_0024_01C11D49.48578D40
	charset="iso-8859-1"

new topic     » topic index » view message » categorize

2. Re: display_image()

This is a multi-part message in MIME format.

------=_NextPart_000_000E_01C11D06.FCC0FD40
	charset="iso-8859-1"

you need to look into manipulating the palette in DOS.
'palutil' on the user contrib page should give you some
insight.

Euman
euman at bellsouth.net
  ----- Original Message -----
  From: pwcroft at home.com
  To: EUforum
  Sent: Sunday, August 05, 2001 02:55
  Subject: display_image()



  I'm using display_image() and I'm having the following problem. I use it
once, to display the picture of a map, then again, to put a picture of a
compass in the corner of the screen. But when I display the compass, the map
vanishes, and I have a black screen, with the compass in the corner. Why is
that?  How do I fix it?

  Thanks for your time, all.

  -Phil



------=_NextPart_000_000E_01C11D06.FCC0FD40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

new topic     » goto parent     » topic index » view message » categorize

3. Re: display_image()

This is a multi-part message in MIME format.

------=_NextPart_000_0374_01C11D59.A1077580
	charset="iso-8859-1"

new topic     » goto parent     » topic index » view message » categorize

4. Re: display_image()

On Sunday 05 August 2001 05:52, pwcroft at home.com wrote:

>     I'm using display_image() and I'm having the following problem. I use
> it once, to display the picture of a map, then again, to put a picture of a
> compass in the corner of the screen. But when I display the compass, the
> map vanishes, and I have a black screen, with the compass in the corner.
> Why is that?  How do I fix it?

Are you trying to overlap the images? That won't work (without some extra
effort) because bitmaps don't support transparency.

If the images are NOT overlapping, you still have to arrive at a common 
"palette" of colors. If you are using, for example, 256 colors, DOS keeps 
an array of [0...255], and in each element of that array, stores the color 
value for that color.  If color[12] = 0, then color[12] would be black. 
Your bitmaps have a similar array attached (the palette) which may 
have some other value altogether stored in color[12].  Loading a new 
bitmap can change all the colors of the bitmap which is already on display.

It's quite possible that your compass bitmap has only a few colors, with 
zero stored in the rest of the color array. Therefor, most or all of the 
colors in your map get changed to black when the compass is loaded.

The way to avoid this is to convert all your bitmaps to use the same,
common set of colors. Most good photo editing programs can do that,
programs like PaintShop Pro.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

5. Re: display_image()

I'm still a little lost. What is the easiest ways to use transparency? Best
example?

----- Original Message -----
From: "Irv Mullins" <irvm at ellijay.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: display_image()


>
> On Sunday 05 August 2001 05:52, pwcroft at home.com wrote:
>
> >     I'm using display_image() and I'm having the following problem. I
use
> > it once, to display the picture of a map, then again, to put a picture
of a
> > compass in the corner of the screen. But when I display the compass, the
> > map vanishes, and I have a black screen, with the compass in the corner.
> > Why is that?  How do I fix it?
>
> Are you trying to overlap the images? That won't work (without some extra
> effort) because bitmaps don't support transparency.
>
> If the images are NOT overlapping, you still have to arrive at a common
> "palette" of colors. If you are using, for example, 256 colors, DOS keeps
> an array of [0...255], and in each element of that array, stores the color
> value for that color.  If color[12] = 0, then color[12] would be black.
> Your bitmaps have a similar array attached (the palette) which may
> have some other value altogether stored in color[12].  Loading a new
> bitmap can change all the colors of the bitmap which is already on
display.
>
> It's quite possible that your compass bitmap has only a few colors, with
> zero stored in the rest of the color array. Therefor, most or all of the
> colors in your map get changed to black when the compass is loaded.
>
> The way to avoid this is to convert all your bitmaps to use the same,
> common set of colors. Most good photo editing programs can do that,
> programs like PaintShop Pro.
>
> Regards,
> Irv
>
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

6. Re: display_image()

On Sunday 05 August 2001 10:12, pwcroft at home.com wrote:
>
> I'm still a little lost. What is the easiest ways to use transparency? Best
> example?

Well, since bitmaps don't support transparency, it's pretty much a matter 
of choosing a color value to be "transparent", and then writing a routine 
to put your image on the screen pixel-by-pixel, skipping those pixels which 
are colored "transparent".

Search the RDS archives on the word "transparent" - you'll see several 
contributions which will help.

Regards,
Irv

new topic     » goto parent     » topic index » view message » categorize

7. Re: display_image()

try a search for Colin Taylor or Palette

Palette Management Utilities  Colin Taylor    1/24/99
(pal_util.e)   

His code will show you how to get around the 
palette problem....sortof

I personaly use this prefered way.

Irv mentioned useing the same palette for multiple
images... Jasc PaintShop Pro is probably the best
Ive seen to handle images. 

I first create the main image or convert an existing image to 16million
colors then, convert the same image useing JASC back to 256 colors then I use:

   Optimized Median Cut
   Error Diffusion
   and Reduce Color Bleeding

I then save that palette to a file from the initial image and apply this saved
palette to any image I create after this for the same project.

Euman
euman at bellsouth.net


----- Original Message ----- 
From: "Irv Mullins" <irvm at ellijay.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, August 05, 2001 21:25
Subject: Re: display_image()


> 
> On Sunday 05 August 2001 10:12, pwcroft at home.com wrote:
> >
> > I'm still a little lost. What is the easiest ways to use transparency? Best
> > example?
> 
> Well, since bitmaps don't support transparency, it's pretty much a matter 
> of choosing a color value to be "transparent", and then writing a routine 
> to put your image on the screen pixel-by-pixel, skipping those pixels which 
> are colored "transparent".
> 
> Search the RDS archives on the word "transparent" - you'll see several 
> contributions which will help.
> 
> Regards,
> Irv
> 
> 
> 
> 
>

new topic     » goto parent     » topic index » view message » categorize

8. Re: display_image()

Phil wrote:

> I'm still a little lost. What is the easiest ways to use
transparency? Best
> example?

The attached routine is definitely *not* the best example, but it's
usually fast enough for me.

jiri


global procedure merge_image(
    integer x,      -- top left corner, horizontal coordinate
    integer y,      -- top left corner, vertical coordinates
    sequence image, -- 2-d image sequence
    integer c       -- transparent cell color index
    )
    --  display 2-d sequence im at point x,y
    --  image cells of color c are considered transparent
    --  with 'on-the-fly' run-length-encoding

    sequence row
    integer f,k,w

    x -= 1
    for i=1 to length(image) do
        row=image[i]
        w = length(row)
        f=0                 -- not in run
        for j=1 to w do
            if row[j]=c then
                if f then
                    pixel(row[k..j-1],{x+k,y})
                    f=0
                end if
            else
                if not f then
                    k=j
                    f=1
                end if
            end if
        end for
        if f then
            pixel(row[k..w],{x+k,y})
        end if
        y+=1
    end for
end procedure -- merge_image

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu