Author Topic: Help Wanted: What is the color of the pixel?  (Read 4056 times)

0 Members and 1 Guest are viewing this topic.

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Help Wanted: What is the color of the pixel?
« on: February 04, 2007 »
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.

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Help Wanted: What is the color of the pixel?
« Reply #1 on: February 04, 2007 »
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.
« Last Edit: February 04, 2007 by zawran »

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Help Wanted: What is the color of the pixel?
« Reply #2 on: February 04, 2007 »
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:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: Help Wanted: What is the color of the pixel?
« Reply #3 on: February 04, 2007 »
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.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Help Wanted: What is the color of the pixel?
« Reply #4 on: February 05, 2007 »
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:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Help Wanted: What is the color of the pixel?
« Reply #5 on: February 05, 2007 »
Stick with PTC though mate. Rbraz and Jim made such a good job on the new one :)
Shockwave ^ Codigos
Challenge Trophies Won:

Offline .:] Druid [:.

  • freebasic n00b
  • Pentium
  • *****
  • Posts: 563
  • Karma: 47
    • View Profile
    • Intro-Inferno
Re: Help Wanted: What is the color of the pixel?
« Reply #6 on: February 05, 2007 »
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.

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Help Wanted: What is the color of the pixel?
« Reply #7 on: February 05, 2007 »
Cool :) Thanks for checking back.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: Help Wanted: What is the color of the pixel?
« Reply #8 on: February 05, 2007 »
Quote
put 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: