• Welcome to Dark Bit Factory & Gravity.
 

Help Wanted: What is the color of the pixel?

Started by .:] Druid [:., February 04, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

.:] Druid [:.

Hello,

I'm wondering if there is any way (i'm sure..) to know what's the color of the pixel i'm about to write on....
to make it clear, i'm willing to print on screen only if the background is rgb(0,0,0) as an exemple?

Any idea is welcome :)

Thanks in advance!
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

zawran

#1
You might want to tell which method of rendering to the screen you are using as methods of getting the RGB of a pixel might very depending on the render surface. Depending on what library you are taking advantage of there might be a command like readpixel or getRGB, or there might not be any commands and you will have to write something up yourself, like when using an arraybuffer or a piece of memory to store the screen in.

Shockwave

Druid is using tinyptc in most of his stuff Zawran.

If you want to make sure that the pixel is black then you could just say;

if buffer ( location ) = &H000000 then buffer ( location ) = new colour

where location = (XPOS +(YPOS * XRES))
Shockwave ^ Codigos
Challenge Trophies Won:

.:] Druid [:.

wow, thanks for your fast replies :) 

Yes, indeed as said, i use tinyptc (are there other method? :))..and your'e right shock, I remember reading this!  Thanks guys :)
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Clyde

There are many other methods dude, to name two there's GFX Lib and you can also use SDL. In the example folder of FreeBASIC there's source on showing what FB can do and how to use various libraries and dll's.

You will also have to download the main .dlls and put them into your system or system32 folder for them to run properlly. Here's a link to see what you can do and use: List Of External Libraries
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Shockwave

Stick with PTC though mate. Rbraz and Jim made such a good job on the new one :)
Shockwave ^ Codigos
Challenge Trophies Won:

.:] Druid [:.

it works like a charm!  thanks to all of you :)
[sheep]: im sure he wants to goto prison.. they didnt get him last time.. he was promised a big cock up his arse.. and no doubt looking forward to it.. lets hope he gets his wish this year.

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

Jim

Quoteput them into your system or system32 folder
That's not the best place to put them.  Put the DLLs in the same folder as your exe.  If there are then two dlls with different incompatible versions or two dlls with the same name from different places, they won't conflict with each other.  Takes up a bit more space with multiple copies, but really, the Windows folder is for Windows files.  In fact, unless you switch to Administrator, Vista won't let you copy files in there anyway. :D

Jim
Challenge Trophies Won: