HP Forums

Full Version: GETPIX_P values
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When using a GETPIX_P(Gn,X,Y) command on a white (#FFFFFFh) pixel I get #F8F8F8h, seems the last 3 bits are not detected. GETPIX on a #070707h pixel gives 0. Why?

/Andreas
Pixels are formatted as ARGB1555 (5 bits per color + 1 alpha)
Screen is in 15 bits colors + 1 bit Alpha, but commands are using 24 bits color coding.
The 24 bits color coding is used because it is the web standard.
So GETPIX is reading the real 15 bits color and converting to 24 bits. The internal white #7fffH is converted to #f8f8f8H
Here is a little program that display all colors
Code:
EXPORT SHOW_CLR()
BEGIN
LOCAL cr, cg, cb, clr, pc, pl;
RECT();
FOR cr FROM 0 TO 31 DO
  pl:= cr MOD 8* 34;
  pc:= IP(cr/8)* 34;
  FOR cg FROM 0 TO 31 DO
    FOR cb FROM 0 TO 31 DO
      clr:= RGB(cr*8,cg*8,cb*8);
      PIXON_P(cb+pl+2,cg+pc+2,clr);
    END;
  END;
END;

REPEAT
UNTIL GETKEY() == -1;
FREEZE;
END;

EXPORT SHOW_BW()
BEGIN
LOCAL cr, cg, cb, clr, pc, pl;
RECT();
FOR cr FROM 0 TO 31 DO
  pl:= cr MOD 8*34;
  pc:= IP(cr/8)*34;
  FOR cg FROM 0 TO 31 DO
    FOR cb FROM 0 TO 31 DO
      clr:= RGB(cr*8,cr*8,cr*8);
      PIXON_P(cb+pl+2,cg+pc+2,clr);
    END;
  END;
END;

REPEAT
UNTIL GETKEY() == -1;
FREEZE;
END;
Thank you for the replies. I did not see this in the manual, but maybe its there.
Reference URL's