1. problems with colors

------=_NextPart_000_001E_01BF879C.498A1FA0
        charset="iso-8859-2"
Content-Transfer-Encoding: quoted-printable

problem no 1:
can anyone tell me how can i display many different colors at hte same =
time on the screen in euphoria dos program?

i want to draw many lines with slightly different colors
rgb=3D0,0,0 rgb=3D1,0,0 ....


i used palette() function

when using draw_line(colornum,....) function in loop statement and=20
value of 'colornum' is being changed evry time, also all the lines which =
were drawn with colornum become colored with value that colornum =
currently has
this sux!

here's code:

atom mycolor
atom r,g,b,x,y,cn
r=3D1
g=3D1
b=3D1
x=3D0
y=3D0
cn=3D0

bk_color(BLUE)


while 1 do
--Here the main thing

       mycolor =3D palette(cn, {r,g,b})
      draw_line(cn, {{x, y}, {x, y+200}})

      cn=3Dcn+1

            x=3Dx+1
           r=3Dr+1

           if(x>500)then
                       exit
                     end if

 if get_key() !=3D -1 then
     exit
 end if
     end while

     while 1 do

      if get_key() !=3D -1 then
     exit
 end if
     end while

end procedure

Problem no2:
in win32lib program
i use mcolor=3Drgb(r,g,b) function, and r goes from 0-255 as in C
, these colors should all be slightly different, not two same, but there =
ar ten, or more, same, and then again different
whats wrong

PROBLEM no 3:
Win32Lib
when calling xPostQuitMessage C fucntion it says theres an error
when calling other C functions theres no error


If anyone is working on artificial intelligence program, send code to me

------=_NextPart_000_001E_01BF879C.498A1FA0
        charset="iso-8859-2"
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-2" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3401" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>problem no 1:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>can anyone tell me how&nbsp;can i =
display many=20
different colors at hte same time on the screen</FONT><FONT face=3DArial =
size=3D2>=20
in euphoria dos program?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i want to draw many lines with slightly =
different=20
colors</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>rgb=3D0,0,0 <FONT face=3DArial =
size=3D2>rgb=3D1,0,0=20
....</FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i used palette() function</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>when using draw_line(colornum,....) =
function in=20
loop statement and </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>value of 'colornum' is being changed =
evry time,=20
also all the lines which were drawn with colornum become colored with =
value that=20
colornum currently has</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>this sux!</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>here's code:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>atom mycolor<BR>atom=20
></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>bk_color(BLUE)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><BR>while 1 do<BR>--Here the main=20
thing</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
mycolor =3D=20
palette(cn, {r,g,b})<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; draw_line(cn, =
{{x, y},=20
{x, y+200}})</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
cn=3Dcn+1</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
p;=20
r=3Dr+1</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial=20
&nbsp;=20
end if</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;if get_key() !=3D -1=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp; exit<BR>&nbsp;end=20
if<BR>&nbsp;&nbsp;&nbsp;&nbsp; end while</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; while 1 =
do</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;if =
get_key() !=3D -1=20
then<BR>&nbsp;&nbsp;&nbsp;&nbsp; exit<BR>&nbsp;end=20
if<BR>&nbsp;&nbsp;&nbsp;&nbsp; end while</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>end procedure</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Problem no2:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>in win32lib =

program</FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i use mcolor=3Drgb(r,g,b) function, and =
r goes from=20
0-255 as in C</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>, these colors should all be slightly =
different,=20
not two same, but there ar ten, or more, same, and then again=20
different</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>whats wrong</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>PROBLEM no 3:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Win32Lib</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>when calling xPostQuitMessage C =
fucntion it says=20
theres an error</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>when calling other C functions theres =
no=20
error</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3DArial size=3D2>If anyone =
is working on=20
artificial intelligence program, send code to=20

------=_NextPart_000_001E_01BF879C.498A1FA0--

new topic     » topic index » view message » categorize

2. Re: problems with colors

=A9koda wrote:

> these colors should all be slightly different,=20
> not two same, but there ar ten, or more, same,=20
> and then again different
> whats wrong

The colors *are* all slightly different. The problem is that there are =
more
colors than your monitor can display. You'll get this banding effect at =
any
resolution less than 24 bit color.


> when calling xPostQuitMessage C function it=20
> says there's an error
> when calling other C functions theres no error

What line in the code is generating an error? You should probably use:

   closeWindow( id )

instead, where 'id' is the id of your main window.

-- David Cuny

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

3. Re: problems with colors

On Mon, 6 Mar 2000, [iso-8859-2] =A9koda wrote:

> problem no 1:
> can anyone tell me how can i display many different colors at the same
> time on the screen in euphoria dos program?

Your example was a bit confusing so I wrote a working example that
demonstrates using the 'palette' function (note that DOS Euphoria by
itself only supports graphics modes of up to 256 colors):


-- start palette demo code --
include graphics.e
include get.e

object mycolor, n
integer gm

-- need a graphics mode that supports 256 colors
if graphics_mode(19) then
  puts(1, "Need VGA graphics!\n" )
  abort(1)
end if

-- set Palette:
for i =3D 0 to 63 do
  -- color 0-63: shades of red
  mycolor =3D palette( i, {i,0,0} )
  -- color 64-127: shades of green
  mycolor =3D palette( i+64, {0,i,0} )
  -- color 128-191: shades of blue
  mycolor =3D palette( i+128, {0,0,i} )
  -- color 192-255: shades of white
  mycolor =3D palette( i+192, {i,i,i} )
end for

for i =3D 0 to 255 do
  draw_line( i, {{i,0}, {i,199}} )
end for

n =3D wait_key()

-- restore original graphics mode
graphics_mode(-1)

-- end palette demo --

-- Brian

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

4. Re: problems with colors

On Mon, 6 Mar 2000, Brian K. Broker wrote:

Sorry, one little error in my example, the last line should read

gm = graphics_mode(-1)

instead of...

> -- restore original graphics mode
> graphics_mode(-1)
>
> -- end palette demo --
>
> -- Brian
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu