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 Professional Discussion / Bitmap pixel colour!!!

Author
Message
Puzzler
23
Years of Service
User Offline
Joined: 18th Jan 2003
Location: United Kingdom
Posted: 17th Nov 2003 22:00
Hi every1,
Is there a way in which you can find the rgb colour value of an individual pixel in a loaded bitmap image?

I've looked through the reference manual and the help file and can't find anything, but i'm not sure if it's been discussed here already.

Piecing together the puzzle of Dark Basic- Puzzler

AMD Athlon 500 MHZ (393216K), NVidia TNT, Windows XP Professional Edition
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 17th Nov 2003 23:45
Use the Point function to read pixels.

i.e.

RGBcolour=POint(xpos,ypos)


The only thing to keep in mind is the bitmap buffers will be the same depth as the display buffer (screen 0). So if your running your app in 16bit mode, and load in 24bit bitmap, the colours you get in return will have been cropped.

Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]
Puzzler
23
Years of Service
User Offline
Joined: 18th Jan 2003
Location: United Kingdom
Posted: 18th Nov 2003 19:16
Thanks.

I was wondering if there was a way to find the colour of individual pixels in a bitmap without loading it to the screen, but i suppose I could load the bitmap to the screen anyway.

Piecing together the puzzle of Dark Basic- Puzzler

AMD Athlon 500 MHZ (393216K), NVidia TNT, Windows XP Professional Edition
Kevin Picone
23
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 18th Nov 2003 19:29
By default, Bitmap 0 is the screen. If you load your image as bitmap 1 say. The operation will be invisible to the user.

Just make sure you set the current bitmap back to 0 once your done.

Kevin Picone
Play Basic - Visible Worlds - Kyruss II
[url]www.underwaredesign.com[/url]

Login to post a reply

Server time is: 2026-07-26 20:16:30
Your offset time is: 2026-07-26 20:16:30