Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

screen colours (hard to explain) 1

Status
Not open for further replies.

qbasicking

Programmer
Aug 19, 2001
628
US
I want to make the background behind a window be in a shadow. I was at first just going to use gray, but different colours look different when they are darkened. This is how I was planning on going about finding out what colour was in the background.
First GET the pixils all the way around it then figuring out there colour by using the numberic value of the variable, but I realized that black and gray both have the value 0, how can I distinguish between them? Also is there a better way to do this?

I'll post the values for they might help someone else doing the same thing.

black = 0
blue = 1.79362E-43
green = 4.591775E-41
teal = 4.609711E-41
red = 1.175494E-38
magenta = 1.175512E-38
brown = 1.180086E-38
silver = 1.180104E-38
gray = 0
lt blue = -1.793662E-43
lt green = -4.591775E-41
lt teal = -4.609711E-41
lt red = -1.175494E-38
yellow = -1.180086E-38
white = -1.180104E-38
 
I'd suggest that you look in the help files for the command POINT.

What have you written for code so far?

-MD. It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.
 
miggyd:
I don't have the help files on this computer, so I will check it out tomorrow. The code that I have written is too big to post on this site, and the program is not going to be open source. But i can post some of the shadowing code.

x = right+1
y = top
DO
GET (x,y)-(x,y), shdow
IF shdow(1) = 1.79362E-43 THEN PSET (x,y),0
IF shdow(1) = 4.591775E-41 THEN PSET (x,y),1
IF shdow(1) = 4.609711E-41 THEN PSET (x,y),9
IF shdow(1) = 1.175494E-38 THEN PSET (x,y),0
IF shdow(1) = 1.175512E-38 THEN PSET (x,y),4
IF shdow(1) = 1.180086E-38 THEN PSET (x,y),8
IF shdow(1) = 1.180104E-38 THEN PSET (x,y),8
IF shdow(1) = -1.193662E-43 THEN PSET (x,y),3
IF shdow(1) = -4.591775E-41 THEN PSET (x,y),2
IF shdow(1) = -4.609711E-41 THEN PSET (x,y),3
IF shdow(1) = -1.175494E-38 THEN PSET (x,y),4
IF shdow(1) = -1.188086E-38 THEN PSET (x,y),6
IF shdow(1) = -1.180104E-38 THEN PSET (x,y),7
y = y + 1
LOOP UNTIL y = bottom + 1
'i do the same thing for the shadow under the window
'all of the dimensions were called earlier in the program
 
miggyd:
thanks for telling me about POINT, it works a heck of a lot better than my way and is easier.

to everybody: don't buy "Qbasic by Example" it only gives you that basics, and there is very little in it about graphics
 
Glad to have helped.

--MiggyD It's better to have two heads to solve a problem from different angles than to have tunnel vision to a dead end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top