1. Graphics troubles

------=_NextPart_000_0009_01C0011E.746CADE0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Well, I've got some more problems with Euphoria's graphics handling. I =
can't seem to display images beyond 16 colours without having all the =
colours switched. I've tried using get_palette() and dividing it by 4, =
but it only seems to work for one of the pictures. WhatI need is sort of =
a global effect that changes all the bitmaps. Somone mentioned a 'common =
palette' but I don't know how to do that.=20

Also,, what do the numbers in the [] mean?=20

I've seen them in things like

mouse_event[1]    -- then the procedure for the left button down,
mouse_event[2[]   -- then the procedure for the right button down,

thanks for the help.

------=_NextPart_000_0009_01C0011E.746CADE0
        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Well, I've got some more problems with =
Euphoria's=20
graphics handling. I can't seem to display images beyond 16 colours =
without=20
having all the colours switched. I've tried using get_palette() and =
dividing it=20
by 4, but it only seems to work for one of the pictures. WhatI need is =
sort of a=20
global effect that changes <EM>all </EM>the bitmaps. Somone mentioned a =
'common=20
palette' but I don't know how to do that. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Also,, what do the numbers in the [] =
mean?=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I've seen them in things =
like</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>mouse_event[1]&nbsp;&nbsp;&nbsp; -- =
then the=20
procedure for the left button down,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>mouse_event[2[]&nbsp;&nbsp; -- then the =
procedure=20
for the&nbsp;right button down,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks for the =

------=_NextPart_000_0009_01C0011E.746CADE0--

new topic     » topic index » view message » categorize

2. Re: Graphics troubles

>Somone mentioned a 'common palette' but I don't know how to do that.
You could either use a 332-palette, like this:

function Generate332Palette()
sequence p
  p = repeat({0,0,0},256)
  for c=0 to 255 do
   p[c+1][1] = and_bits(floor( and_bits(floor(c/32),7)*255/7),255 )
   p[c+1][2] = and_bits(floor( and_bits(floor(c/4),7)*255/7),255 )
   p[c+1][3] = and_bits(floor( and_bits(c,3)*255/3),255 )
  end for
  p[256] = {255,0,255}
  p[1] = {0,0,0}
  return p
end function

..or you could create a list consisting of every color in all the images'
palettes and use f.x. the 256 most frequent colors.

Step 2 is to convert all images to use the palette you've just created using
color-matching.



>
>Also,, what do the numbers in the [] mean?
>

Those numbers are indexes into that sequence.

Example:

sequence s, s2
integer i
s = {100, "foo", 3.14,'x'}
i = s[1]     -- i=100
s2 = s[2]    -- s2="foo"
s = s[2..3]  -- s={"foo",3.14}


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com

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

Search



Quick Links

User menu

Not signed in.

Misc Menu