GLBasic forum

Other languages => GLBasic - de => Topic started by: WPShadow on 2009-Aug-05

Title: GETPIXEL()
Post by: WPShadow on 2009-Aug-05
Hi!

Wie genau kann man den einzelnen Farbwert bei Getpixel raus bekommen? Die Werte die ich bekomme sind vermutlich HEX, brauchen w?rde ich widerum RGB - Werte von 0 - 255, um einzelne Werte zu errechnen...

Gru?

W.
Title: Re: GETPIXEL()
Post by: Schranz0r on 2009-Aug-05
SuFu:

Code von Quentin:

Code (glbasic) Select
  color = RGB(250, 13, 56)
  red = bAND(color, 255)
  green = bAND(color / 256, 255)
  blue = bAND(color / 256 * 256), 255)
Title: Re: GETPIXEL()
Post by: WPShadow on 2009-Aug-06
Wird eingebaut! thx!!!
Title: Re: GETPIXEL()
Post by: Hemlos on 2009-Aug-06

Hey there WP
The getpixel command is sensitive..

Just a couple tips from a little experience with this command:

Getpixel has a margin of error, if your computer or any computer your program is installed on, has a video card using "antialiasing"(this is very common for game players to use for smoothness of colors).
So to solve this you can do 2 things:
1. If you need it to run dynamically(realtime) then turn off antialiasing...and make a help file for your program to tell your users to do that too.
2. use getpixel(again make sure AA is off) in the development phase of your software, convert the data into data files(you may need to encrypt them), this will allow you to develop, and not need to worry about your users needing to shut off antialiasing.

-Hasta, Hemlos

Title: Re: GETPIXEL()
Post by: WPShadow on 2009-Aug-06
I try to make something like this:

http://www.youtube.com/watch?v=Bcalc8UoJzo

But not as professional as ATI do!  :nana:
Title: Re: GETPIXEL()
Post by: Hemlos on 2009-Aug-06
That is a tile demo, why do you need getpixel for this?
Title: Re: GETPIXEL()
Post by: WPShadow on 2009-Aug-06
Need a little time to show you the first demo!