GetColor ?
Übersicht

![]() |
Mathias-KwiatkowskiBetreff: GetColor ? |
![]() Antworten mit Zitat ![]() |
---|---|---|
GetColor( red Var,green Var,blue Var )
wie wende ich diesen befehl an, ich möchte nun wissen welche farbe der pixel auf x 100 y 100 hat den auch dieser bef is wieder anders als in bb |
||
![]() |
ProfJakeehemals "DTC" / "Fabian Niemann" |
![]() Antworten mit Zitat ![]() |
---|---|---|
Code: [AUSKLAPPEN] SuperStrict
Graphics 640,480,0 SetColor(255,0,0) Local red:int Local green:int Local blue:int GetColor(red, green, blue) Print "RED: " + red Print "GREEN: " + green Print "BLUE: " + blue End [EDIT] Mist, hab mich verlesen. Sorry. Hier der richtige Code. Code: [AUSKLAPPEN] SuperStrict Graphics 640,480,0 Local pixMap:TPixmap = CreatePixmap(GraphicsWidth(), GraphicsHeight(), PF_RGBA8888) Local pixel:Int While Not KeyHit(KEY_ESCAPE) Cls If KeyHit(KEY_ENTER) SetColor(Rand(255), Rand(255), Rand(255)) Plot(100,100) ' FARBE HERAUSFINDEN pixMap = GrabPixmap(0, 0, GraphicsWidth(), GraphicsHeight()) pixel = pixMap.ReadPixel(100,100) DrawText("RED: " + (pixel & $FF0000) / $FFFF, 5, 5) DrawText("GREEN: " + (pixel & $00FF00) / $FF, 5, 15) DrawText("BLUE: " + (pixel & $0000FF), 5, 25) Flip 0 Wend End Ich glaube aber gehört zu haben, dass Pixmaps ziemlich langsam sind, da sie im RAM liegen und nicht von der Grafikkarte berechnet werden. |
||
![]() |
Mathias-Kwiatkowski |
![]() Antworten mit Zitat ![]() |
---|---|---|
Vielen Dank | ||
Übersicht


Powered by phpBB © 2001 - 2006, phpBB Group