|
-
Jun 2nd, 2002, 01:48 PM
#1
Thread Starter
Lively Member
RGB pallet manipulation - blackout and light-up effects
I'm working with Turbo C++ in 13h mode (256 colors) and what I want to do is make a function(s) that would either light-up the entire screen (just like turning up the brightness for all colors) or blackout (all colors going to black). So what I want to know is what's a good algorithm for both? I've written a few functions, for example for the light-up function I would just take the current RGB value for a color and increment all three colors by 1, but that tends to mess up the actual picture (like if one of the colors is at the max already then the other two would increase by them selves changing the actual color and not only the brightness). Any good ideas?
-
Jun 2nd, 2002, 02:24 PM
#2
PowerPoster
You have to move them relative and not absolule. If the original color is 0 / 128 / 255 you have to increase the colors by 1.0 / 0.5 / 0.0 understand the system? So the movement is ( 1 - (Original / 255) ) for each, R, G and B.
-
Jun 3rd, 2002, 11:05 AM
#3
Hyperactive Member
if we use PictureBox
In that case, if I have picturebox control and I want to do that on the picture. So, how could I use BitBlt or anything else to succeed?
Don't leave it till tomorrow, Do It Now!
5361726176757468204368616E63686F747361746869656E

-
Jun 3rd, 2002, 11:58 AM
#4
PowerPoster
BitBlt won't help you on this.. You'll have to go thru each pixel and modulate the color..
-
Jun 3rd, 2002, 01:43 PM
#5
Thread Starter
Lively Member
Go it all working great. Thanks.
-
Jun 3rd, 2002, 02:44 PM
#6
Thread Starter
Lively Member
Hehe very well, this is a bit unfinished but you get the point (didn’t finish the ending sequence). Just a program that I'm making for my final project in my C++ class, no real point though. To quit press Esc and you will see why I wanted these 2 effects. Also, there are 2 versions that I've compiled, for some unknown reason (at least to me) the text memory offset (I'm using direct text output - writing to memory) needs to be changed on some computers. For most computers RACE1.EXE should work fine, but if you see that the text is in the wrong position when you start the program, then try RACE2. Maybe you know why this is? I'm using pokeb() function and address B800 : offset to output the text to the screen yet on my computer the offset for the first character on the screen is 32 instead of 0 as it is on most computers I’ve tried this on.
Well any way, here are the programs:
http://www.tnstop.com/RACE1.EXE
http://www.tnstop.com/RACE2.EXE
I can give you the source if you'd like, but I hate commenting, so it might kinda hard to understand.
Oh and also if you use + and - keys (-/=) you can adjust the speed - I was bored
Last edited by MXK; Jun 3rd, 2002 at 02:47 PM.
-
Jun 3rd, 2002, 03:16 PM
#7
Good Ol' Platypus
I had to use the RACE2 one. If it helps, I'm running a Celeron/Win2000/GF2MX.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 3rd, 2002, 03:21 PM
#8
Thread Starter
Lively Member
Hm...so far what I'm noticing is that any system running Win2k or XP (what I use) has to use the second one, while systems on Win 98 (at my school) use the first one. Strange...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|