Getpixel on Android

Previous topic - Next topic

MrPlow

Hi Guys

I am trying to use getpixel on android but it returns zero with my virtual screen using USESCREEN -1 for my virtual screen.

Anyone got an alternative ?

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

#1
Okay, this is sorted now - made my own color picker in the end  by just creating the colours with code
:)

Code (glbasic) Select
TYPE colsect

x=0
y=0
col% = 0

ENDTYPE
GLOBAL colsects[] AS colsect


LOCAL cx = 0
LOCAL cy = 0
LOCAL counter=0

FOR r= 255 TO 0 STEP -64

FOR g=255 TO 0 STEP -63

FOR b = 255 TO 0 STEP -63

LOCAL cc AS colsect

cc.col = RGB(r,g,b)
cc.x = cx
cc.y = counter*10

DIMPUSH colsects[],cc

INC counter,1

IF counter = 9

counter = 0
INC cx,10

ENDIF
NEXT
NEXT

NEXT
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

UBERmonkeybot

#2
In the past i have used spritetomem() and then accessed the array as  if it were the screen.

spacefractal

As im aware GETPIXELS might not work on all platforms. Im thinks its due Android uses 16bit colors, not 24.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

GETPIXEL also doesn't work in several versions of GLBasic on a number of formats, not just Android. v10 worked on OK on most/all platforms IIRC.
I came. I saw. I played.

MrPlow

Thanks Guys,
I got it sorted anyhow - GETPIXEL was a lazy way out for me, but the best solutions is the one I coded - which can't go wrong on any device... So likely much better off with the work around :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs