Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / point() :S? or maybe something else? color of pixel..

Author
Message
The Dream Keeper!
21
Years of Service
User Offline
Joined: 9th Oct 2003
Location: Netherlands! HOLLAND!
Posted: 14th Feb 2004 13:03
Hey all,

I know.. my title is confusing. Let me explain.. i'm making some kind of convert program.. but then i have to know what color a pixel is.. so the program can store that in a color# but.. i get wierd color numbers. I don't get RGB or something. But things like: 89028394894 :S. And i don't get that. Does anyone know how you can get the red, green and blue value of a pixel? a part from each other?

Thanks for all the help!

The Dream Keeper!

Bring fun to life!!!!!
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 14th Feb 2004 14:14
red = rgbr(point(x,y))
green = rgbg(point(x,y))
blue = rgbb(point(x,y))

that should do it


Quote: "
Amd 2500+ | 1024mb pc2700 | A7N8X-X | Geforce4 ti 4200 128mb
"
The Dream Keeper!
21
Years of Service
User Offline
Joined: 9th Oct 2003
Location: Netherlands! HOLLAND!
Posted: 14th Feb 2004 21:37 Edited at: 14th Feb 2004 21:47
Aha.. thnx. Got that! But another question. I want to check the color of an pixel on a bitmap. But if you have the bitmap at 0,0 for example and you read that pixel. It doesn't read the bitmap but what's under that. I tried the set current bitmap 1. But it didn't work. Anyone got a solution?

Already found the solution. Thanks though.

Bring fun to life!!!!!
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 15th Feb 2004 06:40
Could you post some code, there could be so many influences on bugs in a program, you could find a problem on one part, then find the solution twenty lines up.

Crazy Donut Productions
Current Project: KillZone
The Dream Keeper!
21
Years of Service
User Offline
Joined: 9th Oct 2003
Location: Netherlands! HOLLAND!
Posted: 15th Feb 2004 14:33
Here is my code.. i got it running with an bitmap.. but it is very slow (converting and stuff).. and it does only one line. But you will see that. I hope you guys can help me make it faster and better.. and offcourse solve the big problem..

Thanks for any help,

The Dream Keeper!

Bring fun to life!!!!!
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 15th Feb 2004 16:01
try the lockpixels command before you play with the image and then unlock pixels afterwards, it`s not how you are meant to do it in the manual, but it works fine here.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.
The Dream Keeper!
21
Years of Service
User Offline
Joined: 9th Oct 2003
Location: Netherlands! HOLLAND!
Posted: 15th Feb 2004 21:06
allright.. but what is the lock pixels command. In the index there isn't any command called "lock pixels".

Bring fun to life!!!!!
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 15th Feb 2004 23:22
doh! thats Pro , I got my versions muddled, sorry! , if you have memblocks in your version of DB then make a memblock of the image, do the alterations to the memblock then make it back into an image, thats not so easy since you have to know how the bitmap is stored internaly ie: 32 or 24 bit etc, but you should be able to work this out from the screenmode you are using, cheers.

Mentor.

System spec : Pentium 3.0Ghz, 512MB DDR, 2x160Gb HD (using icewave hd coolers ), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800Pro 128mb.

Login to post a reply

Server time is: 2025-05-23 03:21:54
Your offset time is: 2025-05-23 03:21:54